补全工序单元设定页中英文翻译
Some checks are pending
Release pipeline / publish (push) Waiting to run
Release pipeline / Always run job (push) Waiting to run

This commit is contained in:
sheng
2026-06-28 22:42:25 +08:00
parent 81bed61caf
commit 11817d5dab
7 changed files with 398 additions and 164 deletions

View File

@@ -172,7 +172,117 @@
"optional_param_import_template": "Optional Parameter Import Template", "optional_param_import_template": "Optional Parameter Import Template",
"import_missing_column": "Column [{name}] does not exist in the file. Please check.", "import_missing_column": "Column [{name}] does not exist in the file. Please check.",
"import_duplicate_name": "Name [{name}] is duplicated. Remove duplicates and upload again.", "import_duplicate_name": "Name [{name}] is duplicated. Remove duplicates and upload again.",
"import_duplicate_param": "Parameter [{param}] is duplicated. Remove duplicates and upload again." "import_duplicate_param": "Parameter [{param}] is duplicated. Remove duplicates and upload again.",
"setting_value": "Settings",
"enter_content": "Please enter content",
"content_required": "Content cannot be empty",
"json_format_invalid": "Invalid JSON format",
"rest_time": "Rest Time",
"enter_rest_time": "Please enter rest time",
"precision_range": "Precision Range",
"enter_precision_range": "Please enter precision range",
"minute": "min",
"non_negative_integer": "Please enter an integer greater than or equal to 0",
"global_config": "Global Configuration",
"set_process_step": "Process Steps",
"process_step_no": "Step",
"step_end": "End",
"constant_current_charge": "CC Charge",
"constant_current_voltage_charge": "CC-CV Charge",
"rest": "Rest",
"constant_current_discharge": "CC Discharge",
"cycle": "Cycle",
"constant_current_voltage_discharge": "CC-CV Discharge",
"contact_check_alarm": "Contact Check Alarm",
"curve_sampling_time": "Curve Sampling Time",
"emergency_stop_voltage": "Emergency Stop Voltage",
"slot_temperature_upper": "Slot Temperature Upper Limit",
"slot_fire_upper": "Slot Fire Temperature Upper Limit",
"charge_voltage_upper": "Charge Voltage Upper Limit",
"charge_voltage_lower": "Charge Voltage Lower Limit",
"charge_current_upper": "Charge Current Upper Limit",
"charge_current_lower": "Charge Current Lower Limit",
"charge_capacity_upper": "Charge Capacity Upper Limit",
"charge_capacity_lower": "Charge Capacity Lower Limit",
"discharge_voltage_upper": "Discharge Voltage Upper Limit",
"discharge_voltage_lower": "Discharge Voltage Lower Limit",
"discharge_current_upper": "Discharge Current Upper Limit",
"discharge_current_lower": "Discharge Current Lower Limit",
"discharge_capacity_upper": "Discharge Capacity Upper Limit",
"discharge_capacity_lower": "Discharge Capacity Lower Limit",
"step_status": "Step Status",
"time_seconds": "Time (s)",
"current_ma": "Current (mA)",
"upper_voltage_mv": "Upper Voltage (mV)",
"lower_voltage_mv": "Lower Voltage (mV)",
"delta_voltage_mv": "Delta V (mV)",
"stop_current_ma": "Stop Current (mA)",
"stop_capacity_mah": "Stop Capacity (mA/h)",
"cct_lower_s": "CCT Lower (s)",
"cct_upper_s": "CCT Upper (s)",
"timeover": "TIMEOVER",
"temperature_c": "Temperature (C)",
"temperature_upper_c": "Temperature Upper (C)",
"temperature_lower_c": "Temperature Lower (C)",
"pressure_kg": "Pressure kg",
"end_step_exists": "End step already exists. Cannot add a new row.",
"missing_end_step": "No end step has been added",
"required_step_field_missing": "Required field [{name}] in step {step} is not filled",
"pressure": "Pressure",
"temperature": "Temperature",
"work_time": "Work Time",
"current": "Current",
"stop_current": "Stop Current",
"lower_voltage": "Lower Voltage",
"upper_voltage": "Upper Voltage",
"please_select": "Please select",
"ocv_common_setting": "OCV Common Settings",
"dcir_common_setting": "DCIR Common Settings",
"ocv_read_lower": "OCV Read Lower Limit",
"ocv_read_upper": "OCV Read Upper Limit",
"ir_read_lower": "IR Read Lower Limit",
"ir_read_upper": "IR Read Upper Limit",
"ng_threshold": "NG Threshold",
"contact_check_bad_alarm_count": "Contact Check NG Alarm Count",
"k_value_switch": "K Value Switch",
"process_code": "Process Code",
"k_value_read_lower": "K Value Read Lower Limit",
"k_value_read_upper": "K Value Read Upper Limit",
"work_mode": "Work Mode",
"work_mode_0": "Rest-Charge 1",
"work_mode_1": "Rest-Discharge 1",
"work_mode_2": "Rest-Charge 1-Charge 2",
"work_mode_3": "Rest-Discharge 1-Discharge 2",
"work_mode_4": "Rest-Charge 1-Charge 2-Rest-Charge 1-Charge 2",
"work_mode_5": "Rest-Discharge 1-Discharge 2-Rest-Discharge 1-Discharge 2",
"work_mode_6": "Rest-Charge 1-Charge 2-Rest-Discharge 1-Discharge 2",
"work_mode_7": "Rest-Discharge 1-Discharge 2-Rest-Charge 1-Charge 2",
"work_mode_8": "Rest-Discharge-Rest-Charge",
"work_mode_9": "Rest-Charge-Rest-Discharge",
"max_voltage_drop": "Max Voltage Drop",
"voltage_upper": "Voltage Upper Limit",
"voltage_lower": "Voltage Lower Limit",
"dcr1_upper": "DCR1 Upper Limit",
"dcr1_lower": "DCR1 Lower Limit",
"dcr2_upper": "DCR2 Upper Limit",
"dcr2_lower": "DCR2 Lower Limit",
"contact_alarm_count": "Contact Alarm Count",
"process_data_save_time": "Process Data Save Time",
"stage1_current1": "Stage 1 Current 1",
"stage1_current2": "Stage 1 Current 2",
"stage1_work_time1": "Stage 1 Work Time 1",
"stage1_work_time2": "Stage 1 Work Time 2",
"stage1_rest_time": "Stage 1 Rest Time",
"stage1_sampling_time": "Stage 1 Sampling Time",
"stage2_current1": "Stage 2 Current 1",
"stage2_current2": "Stage 2 Current 2",
"stage2_work_time1": "Stage 2 Work Time 1",
"stage2_work_time2": "Stage 2 Work Time 2",
"stage2_rest_time": "Stage 2 Rest Time",
"stage2_sampling_time": "Stage 2 Sampling Time",
"enter_default_value": "Please enter default value",
"select_unit": "Please select unit",
"name_or_param_exists": "Name or parameter already exists"
}, },
"process_routing": { "process_routing": {
"search": "Search", "search": "Search",

View File

@@ -172,7 +172,117 @@
"optional_param_import_template": "可选参数导入模板", "optional_param_import_template": "可选参数导入模板",
"import_missing_column": "文件不存在【{name}】数据列,请检查", "import_missing_column": "文件不存在【{name}】数据列,请检查",
"import_duplicate_name": "【{name}】名称存在重复值,请去掉重复值并重新上传", "import_duplicate_name": "【{name}】名称存在重复值,请去掉重复值并重新上传",
"import_duplicate_param": "【{param}】参数存在重复值,请去掉重复值并重新上传" "import_duplicate_param": "【{param}】参数存在重复值,请去掉重复值并重新上传",
"setting_value": "设定值",
"enter_content": "请输入内容",
"content_required": "输入内容不能为空",
"json_format_invalid": "JSON 格式不正确",
"rest_time": "静置时间",
"enter_rest_time": "请输入静置时间",
"precision_range": "精度范围",
"enter_precision_range": "请输入精度范围",
"minute": "分钟",
"non_negative_integer": "请输入大于等于 0 的整数",
"global_config": "全局配置",
"set_process_step": "设置工步",
"process_step_no": "工步",
"step_end": "结束",
"constant_current_charge": "恒流充电",
"constant_current_voltage_charge": "恒流恒压充电",
"rest": "搁置",
"constant_current_discharge": "恒流放电",
"cycle": "循环",
"constant_current_voltage_discharge": "恒流恒压放电",
"contact_check_alarm": "接触检查报警",
"curve_sampling_time": "曲线取样时间",
"emergency_stop_voltage": "急停电压",
"slot_temperature_upper": "库位温度上限",
"slot_fire_upper": "库位消防上限",
"charge_voltage_upper": "充电上限电压",
"charge_voltage_lower": "充电下限电压",
"charge_current_upper": "充电上限电流",
"charge_current_lower": "充电下限电流",
"charge_capacity_upper": "充电上限容量",
"charge_capacity_lower": "充电下限容量",
"discharge_voltage_upper": "放电上限电压",
"discharge_voltage_lower": "放电下限电压",
"discharge_current_upper": "放电上限电流",
"discharge_current_lower": "放电下限电流",
"discharge_capacity_upper": "放电上限容量",
"discharge_capacity_lower": "放电下限容量",
"step_status": "工步状态",
"time_seconds": "时间(秒)",
"current_ma": "电流(mA)",
"upper_voltage_mv": "上限电压(mV)",
"lower_voltage_mv": "下限电压(mV)",
"delta_voltage_mv": "ΔV(mV)",
"stop_current_ma": "终止电流(mA)",
"stop_capacity_mah": "终止容量(mA/h)",
"cct_lower_s": "CCT下限(s)",
"cct_upper_s": "CCT上限(s)",
"timeover": "TIMEOVER",
"temperature_c": "温度(℃)",
"temperature_upper_c": "温度上限(℃)",
"temperature_lower_c": "温度下限(℃)",
"pressure_kg": "压力kg",
"end_step_exists": "已有结束工步,不能新增",
"missing_end_step": "检测到没有添加结束工步",
"required_step_field_missing": "第{step}工步的必填项【{name}】没有填写",
"pressure": "压力",
"temperature": "温度",
"work_time": "工作时间",
"current": "电流",
"stop_current": "终止电流",
"lower_voltage": "下限电压",
"upper_voltage": "上限电压",
"please_select": "请选择",
"ocv_common_setting": "OCV 通用设定",
"dcir_common_setting": "DCIR 通用设定",
"ocv_read_lower": "OCV读取下限",
"ocv_read_upper": "OCV读取上限",
"ir_read_lower": "IR读取下限",
"ir_read_upper": "IR读取上限",
"ng_threshold": "NG阈值",
"contact_check_bad_alarm_count": "接触检查不良报警次数",
"k_value_switch": "K值开关",
"process_code": "工序编码",
"k_value_read_lower": "K值读取下限",
"k_value_read_upper": "K值读取上限",
"work_mode": "工作模式",
"work_mode_0": "静置-充电1",
"work_mode_1": "静置-放电1",
"work_mode_2": "静置-充电1-充电2",
"work_mode_3": "静置-放电1-放电2",
"work_mode_4": "静置-充电1-充电2-静置-充电1-充电2",
"work_mode_5": "静置-放电1-放电2-静置-放电1-放电2",
"work_mode_6": "静置-充电1-充电2-静置-放电1-放电2",
"work_mode_7": "静置-放电1-放电2-静置-充电1-充电2",
"work_mode_8": "静置-放电-静置-充电",
"work_mode_9": "静置-充电-静置-放电",
"max_voltage_drop": "最大压降",
"voltage_upper": "电压上限",
"voltage_lower": "电压下限",
"dcr1_upper": "DCR1上限",
"dcr1_lower": "DCR1下限",
"dcr2_upper": "DCR2上限",
"dcr2_lower": "DCR2下限",
"contact_alarm_count": "接触报警次数",
"process_data_save_time": "过程数据保存时间",
"stage1_current1": "阶段1电流1",
"stage1_current2": "阶段1电流2",
"stage1_work_time1": "阶段1工作时间1",
"stage1_work_time2": "阶段1工作时间2",
"stage1_rest_time": "阶段1静置时间",
"stage1_sampling_time": "阶段1采样时间",
"stage2_current1": "阶段2电流1",
"stage2_current2": "阶段2电流2",
"stage2_work_time1": "阶段2工作时间1",
"stage2_work_time2": "阶段2工作时间2",
"stage2_rest_time": "阶段2静置时间",
"stage2_sampling_time": "阶段2采样时间",
"enter_default_value": "请输入默认值",
"select_unit": "请选择单位",
"name_or_param_exists": "名称或参数已存在"
}, },
"process_routing": { "process_routing": {
"search": "查询", "search": "查询",

View File

@@ -1,11 +1,11 @@
<template> <template>
<el-tabs v-model="activeTab" type="card"> <el-tabs v-model="activeTab" type="card">
<el-tab-pane label="设定值" name="process"> <el-tab-pane :label="$t(key('setting_value'))" name="process">
<el-divider content-position="left">{{ config.title }}</el-divider> <el-divider content-position="left">{{ $t(key(config.titleKey)) }}</el-divider>
<el-form :model="form" label-position="right" label-width="160px" size="mini" class="device-setting-form"> <el-form :model="form" label-position="right" label-width="160px" size="mini" class="device-setting-form">
<el-row :gutter="16"> <el-row :gutter="16">
<el-col v-for="field in config.fields" :key="field.prop" :span="12"> <el-col v-for="field in config.fields" :key="field.prop" :span="12">
<el-form-item :label="field.label"> <el-form-item :label="$t(key(field.labelKey))">
<el-checkbox <el-checkbox
v-if="field.type === 'checkbox'" v-if="field.type === 'checkbox'"
v-model="form[field.prop]" v-model="form[field.prop]"
@@ -15,7 +15,7 @@
<el-select <el-select
v-else-if="field.type === 'select'" v-else-if="field.type === 'select'"
v-model="form[field.prop]" v-model="form[field.prop]"
placeholder="请选择" :placeholder="$t(key('please_select'))"
clearable clearable
filterable filterable
style="width:100%" style="width:100%"
@@ -23,11 +23,11 @@
<el-option <el-option
v-for="option in field.options" v-for="option in field.options"
:key="option.value" :key="option.value"
:label="option.label" :label="$t(key(option.labelKey))"
:value="option.value" :value="option.value"
/> />
</el-select> </el-select>
<el-input v-else v-model="form[field.prop]" placeholder="请输入内容" clearable> <el-input v-else v-model="form[field.prop]" :placeholder="$t(key('enter_content'))" clearable>
<template v-if="field.unit" slot="append">{{ field.unit }}</template> <template v-if="field.unit" slot="append">{{ field.unit }}</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
@@ -42,6 +42,8 @@
</template> </template>
<script> <script>
import { i18nMixin } from '@/composables/useI18n'
function isJson (value) { function isJson (value) {
if (typeof value !== 'string') return false if (typeof value !== 'string') return false
try { try {
@@ -61,18 +63,18 @@ function parseSetting (value, fallback = { process: {} }) {
const deviceSettingForms = { const deviceSettingForms = {
DvPlugin: { DvPlugin: {
title: 'OCV 通用设定', titleKey: 'ocv_common_setting',
fields: [ fields: [
{ prop: 'ocv_min_read_range', label: 'OCV读取下限', unit: 'mV' }, { prop: 'ocv_min_read_range', labelKey: 'ocv_read_lower', unit: 'mV' },
{ prop: 'ocv_max_read_range', label: 'OCV读取上限', unit: 'mV' }, { prop: 'ocv_max_read_range', labelKey: 'ocv_read_upper', unit: 'mV' },
{ prop: 'ir_min_read_range', label: 'IR读取下限', unit: 'mΩ' }, { prop: 'ir_min_read_range', labelKey: 'ir_read_lower', unit: 'mΩ' },
{ prop: 'ir_max_read_range', label: 'IR读取上限', unit: 'mΩ' }, { prop: 'ir_max_read_range', labelKey: 'ir_read_upper', unit: 'mΩ' },
{ prop: 'NG_threshold', label: 'NG阈值', unit: '' }, { prop: 'NG_threshold', labelKey: 'ng_threshold', unit: 'pcs' },
{ prop: 'pin_count', label: '接触检查不良报警次数', unit: '0不报警' }, { prop: 'pin_count', labelKey: 'contact_check_bad_alarm_count', unit: '0' },
{ prop: 'K_ext', label: 'K值开关', type: 'checkbox' }, { prop: 'K_ext', labelKey: 'k_value_switch', type: 'checkbox' },
{ prop: 'process_code', label: '工序编码' }, { prop: 'process_code', labelKey: 'process_code' },
{ prop: 'K_min_read_range', label: 'K值读取下限', unit: 'mV/h' }, { prop: 'K_min_read_range', labelKey: 'k_value_read_lower', unit: 'mV/h' },
{ prop: 'K_max_read_range', label: 'K值读取上限', unit: 'mV/h' } { prop: 'K_max_read_range', labelKey: 'k_value_read_upper', unit: 'mV/h' }
], ],
defaults: { defaults: {
ocv_min_read_range: undefined, ocv_min_read_range: undefined,
@@ -87,48 +89,48 @@ const deviceSettingForms = {
} }
}, },
OcvrPlugin: { OcvrPlugin: {
title: 'DCIR 通用设定', titleKey: 'dcir_common_setting',
fields: [ fields: [
{ {
prop: 'SETWKMODE', prop: 'SETWKMODE',
label: '工作模式', labelKey: 'work_mode',
type: 'select', type: 'select',
options: [ options: [
{ label: '静置-充电1', value: '0' }, { labelKey: 'work_mode_0', value: '0' },
{ label: '静置-放电1', value: '1' }, { labelKey: 'work_mode_1', value: '1' },
{ label: '静置-充电1-充电2', value: '2' }, { labelKey: 'work_mode_2', value: '2' },
{ label: '静置-放电1-放电2', value: '3' }, { labelKey: 'work_mode_3', value: '3' },
{ label: '静置-充电1-充电2-静置-充电1-充电2', value: '4' }, { labelKey: 'work_mode_4', value: '4' },
{ label: '静置-放电1-放电2-静置-放电1-放电2', value: '5' }, { labelKey: 'work_mode_5', value: '5' },
{ label: '静置-充电1-充电2-静置-放电1-放电2', value: '6' }, { labelKey: 'work_mode_6', value: '6' },
{ label: '静置-放电1-放电2-静置-充电1-充电2', value: '7' }, { labelKey: 'work_mode_7', value: '7' },
{ label: '静置-放电-静置-充电', value: '8' }, { labelKey: 'work_mode_8', value: '8' },
{ label: '静置-充电-静置-放电', value: '9' } { labelKey: 'work_mode_9', value: '9' }
] ]
}, },
{ prop: 'VDROP', label: '最大压降' }, { prop: 'VDROP', labelKey: 'max_voltage_drop' },
{ prop: 'SETUPV', label: '电压上限', unit: 'mV' }, { prop: 'SETUPV', labelKey: 'voltage_upper', unit: 'mV' },
{ prop: 'SETLWV', label: '电压下限', unit: 'mV' }, { prop: 'SETLWV', labelKey: 'voltage_lower', unit: 'mV' },
{ prop: 'DCR1_up', label: 'DCR1上限', unit: 'mΩ' }, { prop: 'DCR1_up', labelKey: 'dcr1_upper', unit: 'mΩ' },
{ prop: 'DCR1_low', label: 'DCR1下限', unit: 'mΩ' }, { prop: 'DCR1_low', labelKey: 'dcr1_lower', unit: 'mΩ' },
{ prop: 'DCR2_up', label: 'DCR2上限', unit: 'mΩ' }, { prop: 'DCR2_up', labelKey: 'dcr2_upper', unit: 'mΩ' },
{ prop: 'DCR2_low', label: 'DCR2下限', unit: 'mΩ' }, { prop: 'DCR2_low', labelKey: 'dcr2_lower', unit: 'mΩ' },
{ prop: 'REST_T', label: '静置时间', unit: 's' }, { prop: 'REST_T', labelKey: 'rest_time', unit: 's' },
{ prop: 'NG_threshold', label: 'NG阈值', unit: '' }, { prop: 'NG_threshold', labelKey: 'ng_threshold', unit: 'pcs' },
{ prop: 'contact_alarm', label: '接触报警次数', unit: '0不报警' }, { prop: 'contact_alarm', labelKey: 'contact_alarm_count', unit: '0' },
{ prop: 'time_interval', label: '过程数据保存时间', unit: 'ms' }, { prop: 'time_interval', labelKey: 'process_data_save_time', unit: 'ms' },
{ prop: 'I1_1', label: '阶段1电流1', unit: 'mA' }, { prop: 'I1_1', labelKey: 'stage1_current1', unit: 'mA' },
{ prop: 'I1_2', label: '阶段1电流2', unit: 'mA' }, { prop: 'I1_2', labelKey: 'stage1_current2', unit: 'mA' },
{ prop: 'T1_1', label: '阶段1工作时间1', unit: 's' }, { prop: 'T1_1', labelKey: 'stage1_work_time1', unit: 's' },
{ prop: 'T1_2', label: '阶段1工作时间2', unit: 's' }, { prop: 'T1_2', labelKey: 'stage1_work_time2', unit: 's' },
{ prop: 'REST_T_1', label: '阶段1静置时间', unit: 's' }, { prop: 'REST_T_1', labelKey: 'stage1_rest_time', unit: 's' },
{ prop: 'CT_1', label: '阶段1采样时间', unit: 's' }, { prop: 'CT_1', labelKey: 'stage1_sampling_time', unit: 's' },
{ prop: 'I2_1', label: '阶段2电流1', unit: 'mA' }, { prop: 'I2_1', labelKey: 'stage2_current1', unit: 'mA' },
{ prop: 'I2_2', label: '阶段2电流2', unit: 'mA' }, { prop: 'I2_2', labelKey: 'stage2_current2', unit: 'mA' },
{ prop: 'T2_1', label: '阶段2工作时间1', unit: 's' }, { prop: 'T2_1', labelKey: 'stage2_work_time1', unit: 's' },
{ prop: 'T2_2', label: '阶段2工作时间2', unit: 's' }, { prop: 'T2_2', labelKey: 'stage2_work_time2', unit: 's' },
{ prop: 'REST_T_2', label: '阶段2静置时间', unit: 's' }, { prop: 'REST_T_2', labelKey: 'stage2_rest_time', unit: 's' },
{ prop: 'CT_2', label: '阶段2采样时间', unit: 's' } { prop: 'CT_2', labelKey: 'stage2_sampling_time', unit: 's' }
], ],
defaults: { defaults: {
SETUPV: undefined, SETUPV: undefined,
@@ -161,6 +163,7 @@ const deviceSettingForms = {
export default { export default {
name: 'ProcessStepDeviceSettingPlugin', name: 'ProcessStepDeviceSettingPlugin',
mixins: [i18nMixin('page.production_master_data.process_model.process_step')],
props: { props: {
type: { type: String, default: '' }, type: { type: String, default: '' },
settingJson: { default: '' } settingJson: { default: '' }

View File

@@ -1,20 +1,20 @@
<template> <template>
<el-tabs v-model="activeTab" type="card"> <el-tabs v-model="activeTab" type="card">
<el-tab-pane label="设定值" name="process"> <el-tab-pane :label="$t(key('setting_value'))" name="process">
<el-divider content-position="left">全局配置</el-divider> <el-divider content-position="left">{{ $t(key('global_config')) }}</el-divider>
<el-form :model="globalSetting" size="mini" label-width="130px" class="formation-global-form"> <el-form :model="globalSetting" size="mini" label-width="130px" class="formation-global-form">
<el-row :gutter="12"> <el-row :gutter="12">
<el-col v-for="item in globalFields" :key="item.prop" :span="8"> <el-col v-for="item in globalFields" :key="item.prop" :span="8">
<el-form-item :label="item.label"> <el-form-item :label="$t(key(item.labelKey))">
<el-input v-model="globalSetting[item.prop]" placeholder="请输入内容" clearable> <el-input v-model="globalSetting[item.prop]" :placeholder="$t(key('enter_content'))" clearable>
<el-button slot="append">{{ item.unit }}</el-button> <el-button slot="append">{{ item.unit }}</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-divider content-position="left">设置工步</el-divider> <el-divider content-position="left">{{ $t(key('set_process_step')) }}</el-divider>
<el-button type="primary" icon="el-icon-plus" size="mini" style="margin-bottom:10px" @click="addRow">新增一行</el-button> <el-button type="primary" icon="el-icon-plus" size="mini" style="margin-bottom:10px" @click="addRow">{{ $t(key('add_row')) }}</el-button>
<el-table <el-table
:data="tableData" :data="tableData"
border border
@@ -30,13 +30,13 @@
<i v-if="$index < tableData.length - 1" class="el-icon-sort-down formation-sort" @click="moveDown($index)" /> <i v-if="$index < tableData.length - 1" class="el-icon-sort-down formation-sort" @click="moveDown($index)" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="工步" width="56" fixed> <el-table-column :label="$t(key('process_step_no'))" width="56" fixed>
<template slot-scope="{ $index }">{{ $index + 1 }}</template> <template slot-scope="{ $index }">{{ $index + 1 }}</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-for="column in processColumns" v-for="column in processColumns"
:key="column.prop" :key="column.prop"
:label="column.label" :label="$t(key(column.labelKey))"
:width="column.width" :width="column.width"
:fixed="column.prop === 'station'" :fixed="column.prop === 'station'"
> >
@@ -51,16 +51,16 @@
<el-option <el-option
v-for="option in $data[column.options]" v-for="option in $data[column.options]"
:key="option.value" :key="option.value"
:label="option.label" :label="option.labelKey ? $t(key(option.labelKey)) : option.label"
:value="option.value" :value="option.value"
/> />
</el-select> </el-select>
<el-input v-else v-model="row[column.prop]" size="mini" type="number" clearable /> <el-input v-else v-model="row[column.prop]" size="mini" type="number" clearable />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="80" fixed="right"> <el-table-column :label="$t(key('operation'))" width="80" fixed="right">
<template slot-scope="{ $index }"> <template slot-scope="{ $index }">
<el-button type="text" size="mini" style="color:#F56C6C" @click="removeRow($index)">删除</el-button> <el-button type="text" size="mini" style="color:#F56C6C" @click="removeRow($index)">{{ $t(key('delete')) }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -72,6 +72,8 @@
</template> </template>
<script> <script>
import { i18nMixin } from '@/composables/useI18n'
function parseSetting (value, fallback) { function parseSetting (value, fallback) {
if (value === undefined || value === null || value === '') return JSON.parse(JSON.stringify(fallback)) if (value === undefined || value === null || value === '') return JSON.parse(JSON.stringify(fallback))
if (typeof value === 'object') return JSON.parse(JSON.stringify(value)) if (typeof value === 'object') return JSON.parse(JSON.stringify(value))
@@ -84,6 +86,7 @@ function parseSetting (value, fallback) {
export default { export default {
name: 'ProcessStepFormationSettingPlugin', name: 'ProcessStepFormationSettingPlugin',
mixins: [i18nMixin('page.production_master_data.process_model.process_step')],
props: { props: {
settingJson: { default: '' }, settingJson: { default: '' },
workingsubclassCode: { type: String, default: '' } workingsubclassCode: { type: String, default: '' }
@@ -95,13 +98,13 @@ export default {
globalSetting: {}, globalSetting: {},
tableData: [], tableData: [],
stationList: [ stationList: [
{ label: '结束', value: '6' }, { labelKey: 'step_end', value: '6' },
{ label: '恒流充电', value: '1' }, { labelKey: 'constant_current_charge', value: '1' },
{ label: '恒流恒压充电', value: '2' }, { labelKey: 'constant_current_voltage_charge', value: '2' },
{ label: '搁置', value: '3' }, { labelKey: 'rest', value: '3' },
{ label: '恒流放电', value: '4' }, { labelKey: 'constant_current_discharge', value: '4' },
{ label: '循环', value: '5' }, { labelKey: 'cycle', value: '5' },
{ label: '恒流恒压放电', value: '12' } { labelKey: 'constant_current_voltage_discharge', value: '12' }
], ],
timeOverList: [ timeOverList: [
{ label: '', value: '' }, { label: '', value: '' },
@@ -110,40 +113,40 @@ export default {
{ label: 'TYPE_B', value: 'TYPE_B' } { label: 'TYPE_B', value: 'TYPE_B' }
], ],
globalFields: [ globalFields: [
{ prop: 'contact_check', label: '接触检查报警', unit: 'PIN' }, { prop: 'contact_check', labelKey: 'contact_check_alarm', unit: 'PIN' },
{ prop: 'curve_sampling_time', label: '曲线取样时间', unit: 's' }, { prop: 'curve_sampling_time', labelKey: 'curve_sampling_time', unit: 's' },
{ prop: 'device_emg_voltage', label: '急停电压', unit: 'mV' }, { prop: 'device_emg_voltage', labelKey: 'emergency_stop_voltage', unit: 'mV' },
{ prop: 'alarm_temperature_upper', label: '库位温度上限', unit: '℃' }, { prop: 'alarm_temperature_upper', labelKey: 'slot_temperature_upper', unit: '℃' },
{ prop: 'fire_temperature_upper', label: '库位消防上限', unit: '℃' }, { prop: 'fire_temperature_upper', labelKey: 'slot_fire_upper', unit: '℃' },
{ prop: 'upper_charging_voltage', label: '充电上限电压', unit: 'mV' }, { prop: 'upper_charging_voltage', labelKey: 'charge_voltage_upper', unit: 'mV' },
{ prop: 'lower_charging_voltage', label: '充电下限电压', unit: 'mV' }, { prop: 'lower_charging_voltage', labelKey: 'charge_voltage_lower', unit: 'mV' },
{ prop: 'upper_charging_current', label: '充电上限电流', unit: 'mA' }, { prop: 'upper_charging_current', labelKey: 'charge_current_upper', unit: 'mA' },
{ prop: 'lower_charging_current', label: '充电下限电流', unit: 'mA' }, { prop: 'lower_charging_current', labelKey: 'charge_current_lower', unit: 'mA' },
{ prop: 'upper_charging_capacity', label: '充电上限容量', unit: 'mA/h' }, { prop: 'upper_charging_capacity', labelKey: 'charge_capacity_upper', unit: 'mA/h' },
{ prop: 'lower_charging_capacity', label: '充电下限容量', unit: 'mA/h' }, { prop: 'lower_charging_capacity', labelKey: 'charge_capacity_lower', unit: 'mA/h' },
{ prop: 'upper_discharge_voltage', label: '放电上限电压', unit: 'mV' }, { prop: 'upper_discharge_voltage', labelKey: 'discharge_voltage_upper', unit: 'mV' },
{ prop: 'lower_discharge_voltage', label: '放电下限电压', unit: 'mV' }, { prop: 'lower_discharge_voltage', labelKey: 'discharge_voltage_lower', unit: 'mV' },
{ prop: 'upper_discharge_current', label: '放电上限电流', unit: 'mA' }, { prop: 'upper_discharge_current', labelKey: 'discharge_current_upper', unit: 'mA' },
{ prop: 'lower_discharge_current', label: '放电下限电流', unit: 'mA' }, { prop: 'lower_discharge_current', labelKey: 'discharge_current_lower', unit: 'mA' },
{ prop: 'upper_discharge_capacity', label: '放电上限容量', unit: 'mA/h' }, { prop: 'upper_discharge_capacity', labelKey: 'discharge_capacity_upper', unit: 'mA/h' },
{ prop: 'lower_discharge_capacity', label: '放电下限容量', unit: 'mA/h' } { prop: 'lower_discharge_capacity', labelKey: 'discharge_capacity_lower', unit: 'mA/h' }
], ],
processColumns: [ processColumns: [
{ prop: 'station', label: '工步状态', width: 120, type: 'select', options: 'stationList' }, { prop: 'station', labelKey: 'step_status', width: 120, type: 'select', options: 'stationList' },
{ prop: 'time', label: '时间(秒)', width: 120 }, { prop: 'time', labelKey: 'time_seconds', width: 120 },
{ prop: 'current', label: '电流(mA)', width: 120 }, { prop: 'current', labelKey: 'current_ma', width: 120 },
{ prop: 'upperVoltage', label: '上限电压(mV)', width: 120 }, { prop: 'upperVoltage', labelKey: 'upper_voltage_mv', width: 120 },
{ prop: 'lowerVoltage', label: '下限电压(mV)', width: 120 }, { prop: 'lowerVoltage', labelKey: 'lower_voltage_mv', width: 120 },
{ prop: 'stop_DeltaVoltage', label: 'ΔV(mV)', width: 100 }, { prop: 'stop_DeltaVoltage', labelKey: 'delta_voltage_mv', width: 100 },
{ prop: 'stop_Current', label: '终止电流(mA)', width: 120 }, { prop: 'stop_Current', labelKey: 'stop_current_ma', width: 120 },
{ prop: 'stop_Capacity', label: '终止容量(mA/h)', width: 130 }, { prop: 'stop_Capacity', labelKey: 'stop_capacity_mah', width: 130 },
{ prop: 'cct_begin', label: 'CCT下限(s)', width: 100 }, { prop: 'cct_begin', labelKey: 'cct_lower_s', width: 100 },
{ prop: 'cct_end', label: 'CCT上限(s)', width: 100 }, { prop: 'cct_end', labelKey: 'cct_upper_s', width: 100 },
{ prop: 'time_over', label: 'TIMEOVER', width: 120, type: 'select', options: 'timeOverList' }, { prop: 'time_over', labelKey: 'timeover', width: 120, type: 'select', options: 'timeOverList' },
{ prop: 'temperature', label: '温度(℃)', width: 100 }, { prop: 'temperature', labelKey: 'temperature_c', width: 100 },
{ prop: 'upperTemperature', label: '温度上限(℃)', width: 120 }, { prop: 'upperTemperature', labelKey: 'temperature_upper_c', width: 120 },
{ prop: 'lowerTemperature', label: '温度下限(℃)', width: 120 }, { prop: 'lowerTemperature', labelKey: 'temperature_lower_c', width: 120 },
{ prop: 'pressure', label: '压力kg', width: 100 } { prop: 'pressure', labelKey: 'pressure_kg', width: 100 }
] ]
} }
}, },
@@ -229,7 +232,7 @@ export default {
}, },
addRow () { addRow () {
if (this.tableData.some(row => String(row.station) === '6')) { if (this.tableData.some(row => String(row.station) === '6')) {
this.$message.info('已有结束工步,不能新增') this.$message.info(this.$t(this.key('end_step_exists')))
return return
} }
this.tableData.push({ station: '' }) this.tableData.push({ station: '' })
@@ -263,34 +266,34 @@ export default {
}, },
validateProcess () { validateProcess () {
if (!this.tableData.some(row => String(row.station) === '6')) { if (!this.tableData.some(row => String(row.station) === '6')) {
this.$message.info('检测到没有添加结束工步') this.$message.info(this.$t(this.key('missing_end_step')))
return false return false
} }
const process = this.json.process || [] const process = this.json.process || []
for (let n = 0; n < process.length; n++) { for (let n = 0; n < process.length; n++) {
const row = process[n] const row = process[n]
const station = Number(row.station) const station = Number(row.station)
const miss = name => { const miss = labelKey => {
this.showMsg(`${n + 1}工步的必填项 【${name}】 没有填写`) this.showMsg(this.$t(this.key('required_step_field_missing'), { step: n + 1, name: this.$t(this.key(labelKey)) }))
return false return false
} }
if ((this.workingsubclassCode === 'HC' || this.workingsubclassCode === 'FR') && station !== 6) { if ((this.workingsubclassCode === 'HC' || this.workingsubclassCode === 'FR') && station !== 6) {
if (row.pressure === undefined || row.pressure === '') return miss('压力') if (row.pressure === undefined || row.pressure === '') return miss('pressure')
if (row.temperature === undefined || row.temperature === '') return miss('温度') if (row.temperature === undefined || row.temperature === '') return miss('temperature')
} }
if (station === 3) { if (station === 3) {
if (row.time === undefined || row.time === '') return miss('工作时间') if (row.time === undefined || row.time === '') return miss('work_time')
} else if (station === 12 || station === 2) { } else if (station === 12 || station === 2) {
if (row.time === undefined || row.time === '') return miss('工作时间') if (row.time === undefined || row.time === '') return miss('work_time')
if (row.current === undefined || row.current === '') return miss('电流') if (row.current === undefined || row.current === '') return miss('current')
if (row.stop_Current === undefined || row.stop_Current === '') return miss('终止电流') if (row.stop_Current === undefined || row.stop_Current === '') return miss('stop_current')
if (station === 12 && (row.lowerVoltage === undefined || row.lowerVoltage === '')) return miss('下限电压') if (station === 12 && (row.lowerVoltage === undefined || row.lowerVoltage === '')) return miss('lower_voltage')
if (station === 2 && (row.upperVoltage === undefined || row.upperVoltage === '')) return miss('上限电压') if (station === 2 && (row.upperVoltage === undefined || row.upperVoltage === '')) return miss('upper_voltage')
} else if (station === 4 || station === 1) { } else if (station === 4 || station === 1) {
if (row.time === undefined || row.time === '') return miss('工作时间') if (row.time === undefined || row.time === '') return miss('work_time')
if (row.current === undefined || row.current === '') return miss('电流') if (row.current === undefined || row.current === '') return miss('current')
if (station === 4 && (row.lowerVoltage === undefined || row.lowerVoltage === '')) return miss('下限电压') if (station === 4 && (row.lowerVoltage === undefined || row.lowerVoltage === '')) return miss('lower_voltage')
if (station === 1 && (row.upperVoltage === undefined || row.upperVoltage === '')) return miss('上限电压') if (station === 1 && (row.upperVoltage === undefined || row.upperVoltage === '')) return miss('upper_voltage')
} }
} }
return true return true

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-tabs v-model="activeTab" type="card"> <el-tabs v-model="activeTab" type="card">
<el-tab-pane label="设定值" name="process"> <el-tab-pane :label="$t(key('setting_value'))" name="process">
<el-alert <el-alert
v-if="type || code" v-if="type || code"
:title="[type, code].filter(Boolean).join(' / ')" :title="[type, code].filter(Boolean).join(' / ')"
@@ -9,7 +9,7 @@
show-icon show-icon
style="margin-bottom:12px" style="margin-bottom:12px"
/> />
<el-input v-model="textarea" type="textarea" :rows="15" placeholder="请输入内容" /> <el-input v-model="textarea" type="textarea" :rows="15" :placeholder="$t(key('enter_content'))" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="json" name="json"> <el-tab-pane label="json" name="json">
<tree-view :data="json" /> <tree-view :data="json" />
@@ -18,6 +18,8 @@
</template> </template>
<script> <script>
import { i18nMixin } from '@/composables/useI18n'
function parseSetting (value) { function parseSetting (value) {
if (value === undefined || value === null || value === '') return { process: {} } if (value === undefined || value === null || value === '') return { process: {} }
if (typeof value === 'object') return JSON.parse(JSON.stringify(value)) if (typeof value === 'object') return JSON.parse(JSON.stringify(value))
@@ -30,6 +32,7 @@ function parseSetting (value) {
export default { export default {
name: 'ProcessStepJsonSettingPlugin', name: 'ProcessStepJsonSettingPlugin',
mixins: [i18nMixin('page.production_master_data.process_model.process_step')],
props: { props: {
settingJson: { default: '' }, settingJson: { default: '' },
type: { type: String, default: '' }, type: { type: String, default: '' },
@@ -54,14 +57,14 @@ export default {
methods: { methods: {
handleFormSubmit () { handleFormSubmit () {
if (!this.textarea) { if (!this.textarea) {
this.$message.info('输入内容不能为空') this.$message.info(this.$t(this.key('content_required')))
return return
} }
try { try {
this.json.process = JSON.parse(this.textarea) this.json.process = JSON.parse(this.textarea)
this.$emit('submit', this.json) this.$emit('submit', this.json)
} catch (e) { } catch (e) {
this.$message.error('JSON 格式不正确') this.$message.error(this.$t(this.key('json_format_invalid')))
} }
} }
} }

View File

@@ -1,32 +1,32 @@
<template> <template>
<el-tabs v-model="activeTab" type="card"> <el-tabs v-model="activeTab" type="card">
<el-tab-pane label="设定值" name="process"> <el-tab-pane :label="$t(key('setting_value'))" name="process">
<div class="non-standard-setting"> <div class="non-standard-setting">
<div class="setting-search-card"> <div class="setting-search-card">
<el-card class="box-card" style="height:550px"> <el-card class="box-card" style="height:550px">
<div slot="header"> <div slot="header">
<span>查询</span> <span>{{ $t(key('search')) }}</span>
</div> </div>
<el-form label-position="top" :model="searchForm" size="mini"> <el-form label-position="top" :model="searchForm" size="mini">
<el-form-item label="名称"> <el-form-item :label="$t(key('name'))">
<el-input v-model.trim="searchForm.name" placeholder="请输入名称" clearable /> <el-input v-model.trim="searchForm.name" :placeholder="$t(key('enter_name'))" clearable />
</el-form-item> </el-form-item>
<el-form-item label="参数"> <el-form-item :label="$t(key('param'))">
<el-input v-model.trim="searchForm.code" placeholder="请输入参数" clearable /> <el-input v-model.trim="searchForm.code" :placeholder="$t(key('enter_param'))" clearable />
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
</div> </div>
<div class="setting-table"> <div class="setting-table">
<el-table :data="filteredRows" border height="550" style="width:100%"> <el-table :data="filteredRows" border height="550" style="width:100%">
<el-table-column prop="name" label="名称" width="220" show-overflow-tooltip /> <el-table-column prop="name" :label="$t(key('name'))" width="220" show-overflow-tooltip />
<el-table-column prop="code" label="参数" width="180" show-overflow-tooltip /> <el-table-column prop="code" :label="$t(key('param'))" width="180" show-overflow-tooltip />
<el-table-column prop="value" label="默认值" min-width="140" show-overflow-tooltip /> <el-table-column prop="value" :label="$t(key('default_value'))" min-width="140" show-overflow-tooltip />
<el-table-column label="单位" width="140" show-overflow-tooltip> <el-table-column :label="$t(key('unit'))" width="140" show-overflow-tooltip>
<template slot-scope="{ row }">{{ unitMap[row.unit] || row.unit }}</template> <template slot-scope="{ row }">{{ unitMap[row.unit] || row.unit }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注" min-width="160" show-overflow-tooltip /> <el-table-column prop="remark" :label="$t(key('remark'))" min-width="160" show-overflow-tooltip />
<el-table-column label="操作" width="100" fixed="right" align="center"> <el-table-column :label="$t(key('operation'))" width="100" fixed="right" align="center">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-button type="text" icon="el-icon-edit" @click="openEdit(row)" /> <el-button type="text" icon="el-icon-edit" @click="openEdit(row)" />
<el-button type="text" icon="el-icon-delete" style="color:#F56C6C" @click="removeRow(row)" /> <el-button type="text" icon="el-icon-delete" style="color:#F56C6C" @click="removeRow(row)" />
@@ -34,12 +34,12 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="setting-actions"> <div class="setting-actions">
<el-button type="primary" size="small" @click="openAdd">新增一行</el-button> <el-button type="primary" size="small" @click="openAdd">{{ $t(key('add_row')) }}</el-button>
</div> </div>
</div> </div>
</div> </div>
<el-dialog <el-dialog
:title="editIndex >= 0 ? '编辑' : '新增'" :title="editIndex >= 0 ? $t(key('edit')) : $t(key('add'))"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
append-to-body append-to-body
width="800px" width="800px"
@@ -47,23 +47,23 @@
<el-form ref="form" :model="form" :rules="rules" label-width="100px" size="mini"> <el-form ref="form" :model="form" :rules="rules" label-width="100px" size="mini">
<el-row :gutter="16"> <el-row :gutter="16">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="参数" prop="code"> <el-form-item :label="$t(key('param'))" prop="code">
<el-input v-model="form.code" placeholder="请输入参数" clearable /> <el-input v-model="form.code" :placeholder="$t(key('enter_param'))" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="名称" prop="name"> <el-form-item :label="$t(key('name'))" prop="name">
<el-input v-model="form.name" placeholder="请输入名称" clearable /> <el-input v-model="form.name" :placeholder="$t(key('enter_name'))" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="默认值" prop="value"> <el-form-item :label="$t(key('default_value'))" prop="value">
<el-input v-model="form.value" placeholder="请输入默认值" clearable /> <el-input v-model="form.value" :placeholder="$t(key('enter_default_value'))" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单位" prop="unit"> <el-form-item :label="$t(key('unit'))" prop="unit">
<el-select v-model="form.unit" placeholder="请选择单位" filterable clearable style="width:100%"> <el-select v-model="form.unit" :placeholder="$t(key('select_unit'))" filterable clearable style="width:100%">
<el-option <el-option
v-for="item in unitOptions" v-for="item in unitOptions"
:key="item.code" :key="item.code"
@@ -74,15 +74,15 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注"> <el-form-item :label="$t(key('remark'))">
<el-input v-model="form.remark" placeholder="请输入备注" clearable /> <el-input v-model="form.remark" :placeholder="$t(key('enter_remark'))" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer"> <div slot="footer">
<el-button @click="dialogVisible = false">取消</el-button> <el-button @click="dialogVisible = false">{{ $t(key('cancel')) }}</el-button>
<el-button type="primary" @click="submitRow">确定</el-button> <el-button type="primary" @click="submitRow">{{ $t(key('confirm')) }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
</el-tab-pane> </el-tab-pane>
@@ -93,6 +93,7 @@
</template> </template>
<script> <script>
import { i18nMixin } from '@/composables/useI18n'
import { getUnitAll } from '@/api/production-master-data/material-unit' import { getUnitAll } from '@/api/production-master-data/material-unit'
function isJson (value) { function isJson (value) {
@@ -114,6 +115,7 @@ function parseSetting (value, fallback = { process: [] }) {
export default { export default {
name: 'ProcessStepNonStandardSettingPlugin', name: 'ProcessStepNonStandardSettingPlugin',
mixins: [i18nMixin('page.production_master_data.process_model.process_step')],
props: { settingJson: { default: '' } }, props: { settingJson: { default: '' } },
data () { data () {
return { return {
@@ -125,10 +127,10 @@ export default {
editIndex: -1, editIndex: -1,
form: { code: '', name: '', value: '', unit: '', remark: '' }, form: { code: '', name: '', value: '', unit: '', remark: '' },
rules: { rules: {
code: [{ required: true, message: '请输入参数', trigger: 'blur' }], code: [{ required: true, message: this.$t(this.key('enter_param')), trigger: 'blur' }],
name: [{ required: true, message: '请输入名称', trigger: 'blur' }], name: [{ required: true, message: this.$t(this.key('enter_name')), trigger: 'blur' }],
value: [{ required: true, message: '请输入默认值', trigger: 'blur' }], value: [{ required: true, message: this.$t(this.key('enter_default_value')), trigger: 'blur' }],
unit: [{ required: true, message: '请选择单位', trigger: 'change' }] unit: [{ required: true, message: this.$t(this.key('select_unit')), trigger: 'change' }]
}, },
unitOptions: [], unitOptions: [],
unitMap: {} unitMap: {}
@@ -199,7 +201,7 @@ export default {
return index !== this.editIndex && (item.name === this.form.name || item.code === this.form.code) return index !== this.editIndex && (item.name === this.form.name || item.code === this.form.code)
}) })
if (duplicate) { if (duplicate) {
this.$message.error('名称或参数已存在') this.$message.error(this.$t(this.key('name_or_param_exists')))
return return
} }
if (this.editIndex >= 0) { if (this.editIndex >= 0) {

View File

@@ -1,19 +1,21 @@
<template> <template>
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini"> <el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini">
<el-form-item label="静置时间" prop="time"> <el-form-item :label="$t(key('rest_time'))" prop="time">
<el-input v-model="form.time" placeholder="请输入静置时间" clearable> <el-input v-model="form.time" :placeholder="$t(key('enter_rest_time'))" clearable>
<template slot="append">分钟</template> <template slot="append">{{ $t(key('minute')) }}</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="精度范围" prop="time_range"> <el-form-item :label="$t(key('precision_range'))" prop="time_range">
<el-input v-model="form.time_range" placeholder="请输入精度范围" clearable> <el-input v-model="form.time_range" :placeholder="$t(key('enter_precision_range'))" clearable>
<template slot="append">分钟</template> <template slot="append">{{ $t(key('minute')) }}</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>
<script> <script>
import { i18nMixin } from '@/composables/useI18n'
function parseSetting (value) { function parseSetting (value) {
if (value === undefined || value === null || value === '') return { process: {} } if (value === undefined || value === null || value === '') return { process: {} }
if (typeof value === 'object') return JSON.parse(JSON.stringify(value)) if (typeof value === 'object') return JSON.parse(JSON.stringify(value))
@@ -26,14 +28,15 @@ function parseSetting (value) {
export default { export default {
name: 'ProcessStepWaitSettingPlugin', name: 'ProcessStepWaitSettingPlugin',
mixins: [i18nMixin('page.production_master_data.process_model.process_step')],
props: { settingJson: { default: '' } }, props: { settingJson: { default: '' } },
data () { data () {
return { return {
json: { process: {} }, json: { process: {} },
form: { time: undefined, time_range: undefined, alert: '0' }, form: { time: undefined, time_range: undefined, alert: '0' },
rules: { rules: {
time: [{ pattern: /^[0-9]\d*$/, message: '请输入大于等于 0 的整数', trigger: 'change' }], time: [{ pattern: /^[0-9]\d*$/, message: this.$t(this.key('non_negative_integer')), trigger: 'change' }],
time_range: [{ pattern: /^[0-9]\d*$/, message: '请输入大于等于 0 的整数', trigger: 'change' }] time_range: [{ pattern: /^[0-9]\d*$/, message: this.$t(this.key('non_negative_integer')), trigger: 'change' }]
} }
} }
}, },
@@ -61,7 +64,7 @@ export default {
handleFormSubmit () { handleFormSubmit () {
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (!valid) { if (!valid) {
this.$message.error('校验失败') this.$message.error(this.$t(this.key('validation_fail')))
return return
} }
this.$emit('submit', this.json) this.$emit('submit', this.json)