| | |
| | | }}</router-link>
|
| | | <router-link to="/Electrical/Parameter1" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter1')
|
| | | }}</router-link>
|
| | | <!-- <router-link to="/Electrical/Parameter2" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter2')
|
| | | }}</router-link> -->
|
| | | <router-link to="/Electrical/Parameter2" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter2')
|
| | | }}</router-link>
|
| | | <router-link to="/Electrical/Positioning1" tag="el-button" type="text" active-class="blue-button">{{ $t('Positioning1')
|
| | | }}</router-link>
|
| | | <router-link to="/Electrical/Positioning2" tag="el-button" type="text" active-class="blue-button">{{ $t('Positioning2')
|
| | | }}</router-link>
|
| | | </el-breadcrumb>
|
| | |
|
| | | <el-row :gutter="18" >
|
| | | <el-col :span="7" v-for="(dataGroup, groupIndex) in jsonData" :key="groupIndex" class='card'>
|
| | | <el-row :gutter="18" class='card'>
|
| | | <el-col :span="7" v-for="(dataGroup, groupIndex) in jsonData" :key="groupIndex" >
|
| | | <el-card class="json-block">
|
| | | <div class="button-row" style="display: flex; justify-content: space-between;">
|
| | | <div v-for="(item, itemIndex) in dataGroup" :key="itemIndex">
|
| | |
| | | <div class="item-row">
|
| | | <span class="name" style="width:250px;">{{ item.name }}</span>
|
| | | <el-input v-if="item.type === '0'" v-model="item.value" class="input-box"></el-input>
|
| | | <el-button v-if="item.type === '0'" class="input-box" @click="submitDataToBackend();">取地址</el-button>
|
| | | |
| | |
|
| | | |
| | | <el-button v-if="item.type === '0' && item.name !== '格子间距' && item.name !== '出片接片地址' && item.name !== '存片接片地址'" class="input-box" @click="submitDataToBackend();">取地址</el-button>
|
| | | </div>
|
| | | </div>
|
| | |
|
| | |
| | | },
|
| | | created () {
|
| | | this.initWebSocket();
|
| | | console.log('jsonData:', this.jsonData); |
| | | // console.log('jsonData:', this.jsonData); |
| | |
|
| | | },
|
| | | methods: {
|
| | |
| | |
|
| | | // 提交数据到后端
|
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('提交以下数据到后端:', jsonString);
|
| | | // console.log('提交以下数据到后端:', jsonString);
|
| | | socket?.send(jsonString);
|
| | | },
|
| | | initWebSocket () {
|
| | |
| | | let obj = JSON.parse(msg.data);
|
| | | const jsonData2 = this.jsonData;
|
| | | document.addEventListener('mouseover', function(event) {
|
| | | const inputBox = document.querySelector('.card'); // 根据你的实际情况选择正确的选择器
|
| | | if (inputBox && !inputBox.contains(event.target)) {
|
| | | const inputBox = document.querySelectorAll('.el-card__body');
|
| | | const target = event.target;
|
| | | if (inputBox && Array.from(inputBox).every(box => !box.contains(target))) {
|
| | | // 如果鼠标不在输入框内,更新输入框的值
|
| | | // this.submitDataToBackend()
|
| | | const params = obj.params;
|
| | | const parms = obj.params;
|
| | |
|
| | | |
| | | // this.submitDataToBackend()
|
| | | let currentIndex = 0;
|
| | |
|
| | | jsonData2.forEach((group, groupIndex) => {
|
| | | group.forEach((item) => {
|
| | | if (item.type !== '1') {
|
| | | if (params[groupIndex] && params[groupIndex][currentIndex] !== undefined) {
|
| | | item.value = params[groupIndex][currentIndex];
|
| | | }
|
| | | currentIndex++;
|
| | |
|
| | | let index = 0;
|
| | | for (let i = 0; i < jsonData2.length; i++) {
|
| | | let arr = jsonData2[i];
|
| | | for (let j = 0; j < arr.length; j++) {
|
| | | let obj = arr[j];
|
| | | if (obj.type === '0' && Object.prototype.hasOwnProperty.call(obj, 'value')) {
|
| | | obj.value = parms[0][index];
|
| | | index++;
|
| | | }
|
| | | });
|
| | | currentIndex = 0; // 手动重置索引,准备处理下一个分组
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | console.log(jsonData2);
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | // console.log(jsonData2);
|
| | |
|
| | | }
|
| | | });
|