| | |
| | | }}</router-link> |
| | | <router-link to="/Electrical/State" tag="el-button" type="text" active-class="blue-button">{{ $t('State') |
| | | }}</router-link> |
| | | <router-link to="/Electrical/Action" tag="el-button" type="text" active-class="blue-button">{{ $t('Action') |
| | | }}</router-link> |
| | | <!-- <router-link to="/Electrical/Action" tag="el-button" type="text" active-class="blue-button">{{ $t('Action') |
| | | }}</router-link> --> |
| | | <!-- <router-link to="/Electrical/Parameter" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter') |
| | | }}</router-link> --> |
| | | <router-link to="/Electrical/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign') |
| | |
| | | |
| | | <div class="button-row" style="display: flex; justify-content: flex-start;flex-wrap:wrap;"> |
| | | <div v-for="(item, itemIndex) in dataGroup" :key="itemIndex" style="margin: 10px;"> |
| | | <el-button v-if="item.button" :name="item.button.name" style='width:200px;' |
| | | :class="{ 'dow': false, 'op': item.button.value === 1 }" class="action-button" |
| | | <el-button v-if="item.button" v-model="item.button.value" :name="item.button.name" style='width:200px;' |
| | | :class="{ 'dow': item.button.value === 0, 'op': item.button.value === 1 }" class="action-button" |
| | | @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend();">{{ |
| | | item.button.name |
| | | }}</el-button> |
| | |
| | | if (language === 'en-US') { |
| | | this.replaceChineseWithEnglish(); |
| | | } |
| | | this.$forceUpdate(); |
| | | // this.$forceUpdate(); |
| | | |
| | | |
| | | }, |
| | |
| | | socket.close(); |
| | | }, |
| | | updateButtonValue (dataGroup, itemIndex) { |
| | | if (dataGroup[itemIndex].button.value === 1) { |
| | | if (dataGroup[itemIndex].button.value2 === 0) { |
| | | // 如果当前按钮的值是 0,将其设为 1 |
| | | this.$set(dataGroup[itemIndex].button, 'value', 0); |
| | | this.$set(dataGroup[itemIndex].button, 'value2', 1); |
| | | } else { |
| | | // 否则将其设为 0 |
| | | this.$set(dataGroup[itemIndex].button, 'value', 1); |
| | | this.$set(dataGroup[itemIndex].button, 'value2', 0); |
| | | } |
| | | }, |
| | | submitDataToBackend () { |
| | | const inputData = this.jsonData.map(dataGroup => { |
| | | return dataGroup.map(item => { |
| | | if (item.type === '3') { |
| | | return { value: item.button.value }; |
| | | return { value: item.button.value2 }; |
| | | } |
| | | return null; |
| | | }); |
| | |
| | | let obj = JSON.parse(msg.data); |
| | | |
| | | const jsonData2 = this.jsonData; |
| | | |
| | | const parms = obj.params; |
| | | console.log(obj) |
| | | if(parms){ |
| | | // 如果鼠标不在输入框内,更新输入框的值 |
| | | // this.submitDataToBackend() |
| | | const parms = obj.params; |
| | | // const xiaoche = obj.params[3]; |
| | | |
| | | // console.log(parms); |
| | | |
| | | if(obj.params){ |
| | | |
| | | |
| | | |
| | | |
| | | for (let i = 0; i < jsonData2.length; i++) { |
| | | let arr = jsonData2[i]; |
| | | for (let j = 0; j < arr.length; j++) { |