|
@@ -68,7 +68,7 @@
|
|
|
<el-input v-model="form.hmcCode" placeholder="请输入HMC码" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="HMC码参数" label-width="100px" prop="attribute1">
|
|
|
- <el-input v-model="form.attribute1" type="textarea" :rows="2" placeholder="请输入HMC码参数,如:发动机排气温度,燃油流量,机匣频率" />
|
|
|
+ <el-input v-model="form.attribute1" type="textarea" :rows="2" placeholder="请输入HMC码参数,必须带上“时间”参数,如:时间,发动机排气温度,燃油流量,机匣频率" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="判据名称" prop="name">
|
|
|
<el-input v-model="form.name" placeholder="请输入判据名称" />
|
|
@@ -359,16 +359,26 @@ export default {
|
|
|
submit() {
|
|
|
this.$refs['formRef'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- let c = this.form.remarks.slice(2, this.form.remarks.length - 2).split(' ')
|
|
|
- let newFormula = c.map((item) => (item === '\\&\\&' ? '&&' : item))
|
|
|
- this.form.remarks = newFormula.join(' ')
|
|
|
- switch (this.dialogTitle) {
|
|
|
- case '编辑':
|
|
|
- this.updateJudgeFaultLogicAPI()
|
|
|
- break
|
|
|
- case '新增':
|
|
|
- this.addJudgeFaultLogicAPI()
|
|
|
- break
|
|
|
+ const str = this.form.attribute1.replace(/,/g, ',')
|
|
|
+ const content = str.split(',')
|
|
|
+ if (content.includes('时间')) {
|
|
|
+ this.form.attribute1 = str
|
|
|
+ let c = this.form.remarks.slice(2, this.form.remarks.length - 2).split(' ')
|
|
|
+ let newFormula = c.map((item) => (item === '\\&\\&' ? '&&' : item))
|
|
|
+ this.form.remarks = newFormula.join(' ')
|
|
|
+ switch (this.dialogTitle) {
|
|
|
+ case '编辑':
|
|
|
+ this.updateJudgeFaultLogicAPI()
|
|
|
+ break
|
|
|
+ case '新增':
|
|
|
+ this.addJudgeFaultLogicAPI()
|
|
|
+ break
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: 'HMC码参数需要包含“时间”参数'
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
})
|