| | |
| | |
|
| | | <el-form label-width="100px" style="display: flex; flex-wrap: wrap;" :model="messagepack.data">
|
| | | <div id="btn_div">
|
| | | <el-button type="primary" @click="send()" id="xiafa" :disabled="isButtonDisabled">下发参数</el-button>
|
| | | <el-button type="primary" @click="send()" id="xiafa" :disabled="isButtonDisabled">{{ $t('Distribute parameters') }}</el-button>
|
| | |
|
| | | </div>
|
| | | <div class="kuai_div" v-for="(item, index) in record.xyData" :key="index">
|
| | |
| | |
|
| | | </div>
|
| | | </el-form>
|
| | |
|
| | | <div>
|
| | | |
| | | </div>
|
| | | </div>
|
| | |
|
| | |
|
| | | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | <script> |
| | |
|
| | | let socket;
|
| | | import LanguageMixin from '../../lang/LanguageMixin'
|
| | | export default {
|
| | |
| | | mixins: [LanguageMixin],
|
| | | data () {
|
| | | return {
|
| | | dialogVisible: true,
|
| | | password: '',
|
| | | activeButton: '',
|
| | | record: {
|
| | | params: [100, 200, 10, 10, 10, 10],
|
| | |
| | |
|
| | | created () {
|
| | | this.initWebSocket();
|
| | | this.isButtonDisabled = true;
|
| | | this.isButtonDisabled = true; |
| | | },
|
| | | methods: {
|
| | | |
| | | |
| | | |
| | | setActiveButton(buttonName) {
|
| | | this.activeButton = buttonName;
|
| | | },
|
| | |
| | | }
|
| | |
|
| | | let obj = JSON.parse(msg.data);
|
| | |
|
| | |
|
| | | if (obj.params && obj.state){
|
| | |
|
| | |
|
| | | |
| | |
|
| | | this.record.params[0] = obj.params[0];
|
| | | this.record.state = obj.state[0];
|
| | | if (obj.state && obj.state.length > 0) {
|
| | | let isButtonDisabled = this.record.state.includes(1);
|
| | | this.isButtonDisabled = isButtonDisabled;
|
| | |
|
| | | let isButtonDisabled = this.record.state.includes(1);
|
| | | |
| | | // 判断state中是否存在1
|
| | | //console.log(isButtonDisabled)
|
| | | this.isButtonDisabled = isButtonDisabled; // 将判断结果保存到变量isButtonDisabled中
|
| | | // 将判断结果保存到变量isButtonDisabled中
|
| | |
|
| | | for (let a = 0; a <= this.record.params[0].length - 1; a++) {
|
| | | if (!this.record.xyData[a]) {
|
| | |
| | | this.record.xyData[a].value = this.record.params[0][a];
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | //console.log(this.record.xyData);
|
| | | this.$forceUpdate();
|
| | | };
|
| | |
| | | };
|
| | | </script>
|
| | |
|
| | | <style>
|
| | | <style scoped>
|
| | | .kuai_div {
|
| | | width: calc(100% / 2);
|
| | | margin-bottom: 15px;
|
| | |
| | |
|
| | | .el-input__inner {
|
| | | border: 1px solid black;
|
| | | border: none;
|
| | | }
|
| | |
|
| | | .in_mc {
|
| | |
| | |
|
| | | .blue-button {
|
| | | background-color: skyblue;
|
| | | color: #fff;
|
| | | |
| | | }
|
| | | #btn_div {
|
| | | width: 100%;
|