|
|
@ -4,36 +4,42 @@ |
|
|
|
<!-- <DeviceParams :dialogData="dialogData" /> --> |
|
|
|
<div class="control-unit"> |
|
|
|
<span>监控控制开关:</span> |
|
|
|
<el-switch active-color="#13ce66" inactive-color="#ff4949" v-model="swicthLight" active-text="开启" |
|
|
|
<el-switch active-color="#01AAFD" inactive-color="#bbbbbb" v-model="swicthLight" active-text="开启" |
|
|
|
inactive-text="关闭" @change="switchTopState" > </el-switch> |
|
|
|
</div> |
|
|
|
<el-select v-model="controlObject" placeholder="请选择" @change="onControlObjectChange"> |
|
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
<el-input type="text" v-model="openingPoint" @input="validateInput" maxlength="3" |
|
|
|
show-word-limit placeholder="请输入" clearable ></el-input> |
|
|
|
<p v-if="errorMessage" style="color: yellow; font-size: 16px;">{{ errorMessage }}</p> |
|
|
|
<ButtonGradient @click.native="submitForm"> |
|
|
|
确认 |
|
|
|
<!-- <el-input type="text" v-model="openingPoint" @input="validateInput" maxlength="3" |
|
|
|
show-word-limit placeholder="请输入" clearable ></el-input> --> |
|
|
|
|
|
|
|
<div class="contentValue" v-if="isEditor === false"> |
|
|
|
<div class="contentBoard" >{{ openingPoint }}</div> |
|
|
|
<ButtonGradient class="btn" @click.native="isEditor=true;openingPoint1=openingPoint"> |
|
|
|
<i class="el-icon-edit"></i> |
|
|
|
</ButtonGradient> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</Dialog> |
|
|
|
</template> |
|
|
|
<!-- <input class="contentBoard" type="text" v-model="openingPoint" @input="validateInput" maxlength="3" |
|
|
|
show-word-limit placeholder="请输入" clearable ></input> --> |
|
|
|
|
|
|
|
<!-- <el-col :span="24"> |
|
|
|
<input class="contentBoard" placeholder="请输入文字" v-model="openingPoint"></input> |
|
|
|
<ButtonGradient class="btn" style="margin-left: 5px;" @click.native="$emit('onContentEdit', {field:'executeConfig',index,type:'cancel'})"> |
|
|
|
<div class="contentValue" v-else> |
|
|
|
<input class="contentBoard" placeholder="请输入文字" v-model="openingPoint1"></input> |
|
|
|
<ButtonGradient class="btn" style="margin-left: 5px;" @click.native="isEditor=false"> |
|
|
|
<i class="el-icon-refresh-left"></i> |
|
|
|
</ButtonGradient> |
|
|
|
<ButtonGradient class="btn" style="margin-left: 5px;" @click.native="$emit('onContentEdit', {field:'executeConfig',index,type:'confirm'})"> |
|
|
|
<ButtonGradient class="btn" style="margin-left: 5px;" @click.native="isEditor=false;openingPoint=openingPoint1;"> |
|
|
|
<i class="el-icon-check"></i> |
|
|
|
</ButtonGradient> |
|
|
|
</el-col> --> |
|
|
|
</div> |
|
|
|
|
|
|
|
<p v-if="errorMessage" style="color: yellow; font-size: 16px;">{{ errorMessage }}{{ errorMessage!==''?openingPoint:''}}</p> |
|
|
|
<div style="width:100%;"> |
|
|
|
<ButtonGradient style="width:100px;float:right;" @click.native="submitForm"> |
|
|
|
确认 |
|
|
|
</ButtonGradient> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</Dialog> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import Button from "@screen/components/Buttons/Button.vue"; |
|
|
|
import Dialog from "@screen/components/Dialog/index.vue"; |
|
|
@ -76,6 +82,7 @@ |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
isEditor:false, |
|
|
|
OOODValue:'', |
|
|
|
OOOEValue:'', |
|
|
|
OOOFValue:'', |
|
|
@ -95,6 +102,7 @@ |
|
|
|
}], |
|
|
|
controlObject: '', |
|
|
|
openingPoint:'', |
|
|
|
openingPoint1:'', |
|
|
|
errorMessage:'', |
|
|
|
rangeLimits: { |
|
|
|
'000D': { min: 20, max: 55 }, |
|
|
@ -147,15 +155,20 @@ |
|
|
|
this.errorMessage = `请输入 ${limits.min}-${limits.max} 之间的数字`; |
|
|
|
if(this.controlObject=='000D'&&this.OOODValue!=''){ |
|
|
|
this.errorMessage += ` 当前值为:`+this.OOODValue; |
|
|
|
this.openingPoint = this.OOODValue; |
|
|
|
}else if(this.controlObject=='000E'&&this.OOOEValue!=''){ |
|
|
|
this.errorMessage += ` 当前值为:`+this.OOOEValue; |
|
|
|
this.openingPoint = this.OOOEValue; |
|
|
|
}else if(this.controlObject=='000F'&&this.OOOFValue!=''){ |
|
|
|
this.errorMessage += ` 当前值为:`+this.OOOFValue; |
|
|
|
this.openingPoint = this.OOOFValue; |
|
|
|
}else if(this.controlObject=='0010'&&this.OO1OValue!=''){ |
|
|
|
this.errorMessage += ` 当前值为:`+this.OO1OValue; |
|
|
|
this.openingPoint = this.OO1OValue; |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.errorMessage = ''; |
|
|
|
this.openingPoint = ''; |
|
|
|
} |
|
|
|
}, |
|
|
|
onControlObjectChange(value) { |
|
|
@ -167,17 +180,21 @@ |
|
|
|
if (isNaN(inputValue) || inputValue < limits.min || inputValue > limits.max) { |
|
|
|
this.errorMessage = `请选择 ${limits.min}-${limits.max} 之间的数字`; |
|
|
|
if(value=='000D'&&this.OOODValue!=''){ |
|
|
|
this.errorMessage += ` 当前值为:`+this.OOODValue; |
|
|
|
this.errorMessage += ` 当前值为:` |
|
|
|
this.openingPoint = this.OOODValue; |
|
|
|
}else if(value=='000E'&&this.OOOEValue!=''){ |
|
|
|
this.errorMessage += ` 当前值为:`+this.OOOEValue; |
|
|
|
this.errorMessage += ` 当前值为:` |
|
|
|
this.openingPoint = this.OOOEValue; |
|
|
|
}else if(value=='000F'&&this.OOOFValue!=''){ |
|
|
|
this.errorMessage += ` 当前值为:`+this.OOOFValue; |
|
|
|
this.errorMessage += ` 当前值为:` |
|
|
|
this.openingPoint = this.OOOFValue; |
|
|
|
}else if(value=='0010'&&this.OO1OValue!=''){ |
|
|
|
this.errorMessage += ` 当前值为:`+this.OO1OValue; |
|
|
|
this.errorMessage += ` 当前值为:` |
|
|
|
this.openingPoint = this.OO1OValue; |
|
|
|
} |
|
|
|
this.openingPoint = ''; // 清空超出范围的输入 |
|
|
|
} else { |
|
|
|
this.errorMessage = ''; |
|
|
|
this.openingPoint = ''; |
|
|
|
} |
|
|
|
}, |
|
|
|
AddMethods() { |
|
|
@ -265,6 +282,26 @@ |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.contentValue{ |
|
|
|
display: flex; |
|
|
|
width:100%; |
|
|
|
align-items: center; |
|
|
|
margin-bottom: 10px; |
|
|
|
} |
|
|
|
.contentBoard{ |
|
|
|
flex:1; |
|
|
|
background-color: #19425c; |
|
|
|
color:#dfdfdf; |
|
|
|
padding: 9px 0px; |
|
|
|
text-align: center; |
|
|
|
font-weight: bold; |
|
|
|
} |
|
|
|
.btn{ |
|
|
|
height:40px; |
|
|
|
} |
|
|
|
.DeviceControlDialog { |
|
|
|
width: 510px; |
|
|
|
display: flex; |
|
|
@ -283,6 +320,7 @@ |
|
|
|
padding: 9px 0px; |
|
|
|
text-align: center; |
|
|
|
font-weight: bold; |
|
|
|
height:40px; |
|
|
|
} |
|
|
|
.control-wrapper { |
|
|
|
display: flex; |
|
|
|