| | |
| | | <router-link to="/Electrical/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign')
|
| | | }}</router-link>
|
| | | <router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{
|
| | | $t('ServoManual')
|
| | | $t('Parameter')
|
| | | }}</router-link>
|
| | | </el-breadcrumb>
|
| | |
|
| | | <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
|
| | |
|
| | | <router-link to="/Electrical/Servomanualone" tag="el-button" type="text" active-class="blue-button">{{
|
| | | $t('Servomanualone')
|
| | | }}</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/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>
|
| | | <router-link to="/Electrical/ManualonePosition" tag="el-button" type="text" active-class="blue-button">{{
|
| | | $t('ManualonePosition')
|
| | | }}</router-link>
|
| | | <router-link to="/Electrical/ManualonePosition2" tag="el-button" type="text" active-class="blue-button">{{
|
| | | $t('ManualonePosition2')
|
| | | }}</router-link>
|
| | | <router-link to="/Electrical/AutomaticParameterSetting" tag="el-button" type="text" active-class="blue-button">{{
|
| | | $t('AutomaticParameterSetting')
|
| | | <router-link to="/Electrical/Parameter2" tag="el-button" type="text" active-class="blue-button">{{ $t('Automatic State')
|
| | | }}</router-link>
|
| | | <router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{
|
| | | $t('ManualJog')
|
| | | }}</router-link>
|
| | | |
| | | <router-link to="/Electrical/ManualonePosition" tag="el-button" type="text" active-class="blue-button">{{
|
| | | $t('ManualonePosition')
|
| | | }}</router-link>
|
| | |
|
| | | <router-link to="/Electrical/Servomanualone" tag="el-button" type="text" active-class="blue-button">{{
|
| | | $t('Servomanualone')
|
| | | }}</router-link>
|
| | | <!-- <router-link to="/Electrical/Parameter1" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter1')
|
| | | }}</router-link> -->
|
| | | |
| | | <router-link to="/Electrical/Positioning1" tag="el-button" type="text" active-class="blue-button">{{
|
| | | $t('Address parameter settings')
|
| | | }}</router-link>
|
| | | <!-- <router-link to="/Electrical/Positioning2" tag="el-button" type="text" active-class="blue-button">{{
|
| | | $t('Positioning2')
|
| | | }}</router-link> -->
|
| | | |
| | | <!-- <router-link to="/Electrical/ManualonePosition2" tag="el-button" type="text" active-class="blue-button">{{
|
| | | $t('ManualonePosition2')
|
| | | }}</router-link> -->
|
| | | <router-link to="/Electrical/AutomaticParameterSetting" tag="el-button" type="text" active-class="blue-button">{{
|
| | | $t('Speed parameter settings')
|
| | | }}</router-link>
|
| | | |
| | | </el-breadcrumb>
|
| | |
|
| | | <el-row :gutter="10">
|
| | | <el-col :span="12" v-for="(dataGroup, groupIndex) in jsonData" :key="groupIndex">
|
| | | <el-card class="json-block" style="width:585px;">
|
| | | <el-card class="json-block" style="width:585px;margin-bottom: 10px;">
|
| | | <div v-for="(item, itemIndex) in dataGroup" :key="itemIndex" class="item-container">
|
| | | <div class="item-row">
|
| | | <span class="name" style="width:300px;">{{ item.name }}</span>
|
| | | <el-input style="width:250px;" v-if="item.state != 0 && item.type === '0'" v-model="item.value"
|
| | |
|
| | | <el-input style="width:250px;" v-if="item.state != 0 && item.type === '0' && groupIndex === 0" v-model="item.value" @keyup.enter.native="A01start"
|
| | | class="input-box"></el-input>
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 1" v-model="item.value" @keyup.enter.native="A02start"
|
| | | class="input-box"></el-input>
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 2" v-model="item.value" @keyup.enter.native="B01start"
|
| | | class="input-box"></el-input>
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 3" v-model="item.value" @keyup.enter.native="B02start"
|
| | | class="input-box"></el-input>
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0'" v-model="item.value"
|
| | | class="input-box"></el-input>
|
| | | </div>
|
| | | </div>
|
| | |
| | | <div v-for="(item, itemIndex) in dataGroup" :key="itemIndex">
|
| | | <el-button v-if="item.button && language === 'en-US' && item.state != 0" :name="item.button.name"
|
| | | v-model="item.button.value"
|
| | | :class="{ 'action-button': true, 'error-button': item.button.name === 'Fault' && item.button.value === 1, 'error-button2': item.button.name === 'NotZero' && item.button.value === 0,'greenbutton': item.button.name !== 'NotZero' && item.button.name !== 'Fault' && item.button.value === 1 }"
|
| | | :class="{ 'action-button': true, 'error-button': item.button.name === 'Fault' && item.button.value === 1, 'error-button2': item.button.name === 'NotZero' && item.button.value === 0,'error-button3': item.button.name === 'NotZero' && item.button.value === 1,'greenbutton': item.button.name !== 'NotZero' && item.button.name !== 'Fault' && item.button.value === 1 }"
|
| | | @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{
|
| | | item.button.name }}</el-button>
|
| | | <el-button v-if="item.button && language === 'zh-CN' && item.state != 0" :name="item.button.name"
|
| | | v-model="item.button.value"
|
| | | :class="{ 'action-button': true, 'error-button': item.button.name === '故障' && item.button.value === 1, 'error-button2': item.button.name === '未回零' && item.button.value === 0,'greenbutton': item.button.name !== '未回零' && item.button.name !== '故障' && item.button.value === 1 }"
|
| | | :class="{ 'action-button': true, 'error-button': item.button.name === '故障' && item.button.value === 1, 'error-button2': item.button.name === '未回零' && item.button.value === 0,'error-button3': item.button.name === '未回零' && item.button.value === 1,'greenbutton': item.button.name !== '未回零' && item.button.name !== '故障' && item.button.value === 1 }"
|
| | | @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{
|
| | | item.button.name }}</el-button>
|
| | | </div>
|
| | |
| | | </el-card>
|
| | | </el-col>
|
| | | </el-row>
|
| | | <div class="container">
|
| | | |
| | | <component :is="embeddedComponent"></component>
|
| | | </div> |
| | |
|
| | | <!-- <el-button @click="submitDataToBackend">提交数据到后端</el-button> -->
|
| | | </div>
|
| | |
|
| | | </template>
|
| | |
|
| | |
|
| | | <script>
|
| | | import LanguageMixin from '../../lang/LanguageMixin'
|
| | | import data from '../../configuration/Manualoneposition'
|
| | | import { throttle } from 'lodash';
|
| | | import ManualonePosition2 from './ManualonePosition2.vue';
|
| | | let socket;
|
| | | export default {
|
| | | name: "ManualonePosition",
|
| | |
| | | return {
|
| | | jsonData: data,
|
| | | language: this.$i18n.locale,
|
| | | embeddedComponent: ManualonePosition2,
|
| | |
|
| | | // 加载整个data.json文件作为jsonData
|
| | | }
|
| | |
| | |
|
| | |
|
| | | },
|
| | | A01start(){
|
| | |
|
| | | const data = [];
|
| | |
|
| | | for (let i = 0; i < 1; i++) {
|
| | | const inputData = this.jsonData[i].filter(item => item.type === '0').map(item => {
|
| | | return { value: item.value };
|
| | | });
|
| | |
|
| | | const values = inputData.map(item => item.value);
|
| | |
|
| | | data.push(values);
|
| | | }
|
| | | data.push([], [], [],[],[],[]);
|
| | |
|
| | |
|
| | |
|
| | | const jsonObject = { data };
|
| | |
|
| | | // 提交数据到后端
|
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | |
|
| | | },
|
| | | A02start(){
|
| | | const data = [];
|
| | |
|
| | | for (let i = 1; i < 2; i++) {
|
| | | const inputData = this.jsonData[i].filter(item => item.type === '0').map(item => {
|
| | | return { value: item.value };
|
| | | });
|
| | |
|
| | | const values = inputData.map(item => item.value);
|
| | | data.unshift([]);
|
| | | data.push(values);
|
| | | }
|
| | | data.push([], [], [],[],[]);
|
| | |
|
| | |
|
| | |
|
| | | const jsonObject = { data };
|
| | |
|
| | | // 提交数据到后端
|
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | |
|
| | | },
|
| | | B01start(){
|
| | | const data = [];
|
| | |
|
| | | for (let i = 2; i < 3; i++) {
|
| | | const inputData = this.jsonData[i].filter(item => item.type === '0').map(item => {
|
| | | return { value: item.value };
|
| | | });
|
| | |
|
| | | const values = inputData.map(item => item.value);
|
| | | data.unshift([], []);
|
| | | data.push(values);
|
| | | }
|
| | | //data.unshift([]);
|
| | |
|
| | | data.push([], [], [],[]);
|
| | |
|
| | |
|
| | | const jsonObject = { data };
|
| | |
|
| | | // 提交数据到后端
|
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | |
|
| | | },
|
| | | B02start(){
|
| | | const data = [];
|
| | |
|
| | | for (let i = 3; i < 4; i++) {
|
| | | const inputData = this.jsonData[i].filter(item => item.type === '0').map(item => {
|
| | | return { value: item.value };
|
| | | });
|
| | |
|
| | | const values = inputData.map(item => item.value);
|
| | | data.unshift([], [], []);
|
| | | data.push(values);
|
| | | }
|
| | |
|
| | | data.push([], [],[]);
|
| | |
|
| | |
|
| | |
|
| | | const jsonObject = { data };
|
| | |
|
| | | // 提交数据到后端
|
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | |
|
| | | },
|
| | | submitDataToBackend (currentButtonName) {
|
| | | if (currentButtonName === 'A01启动' || currentButtonName === 'A01 Start') {
|
| | | const data = [];
|
| | |
|
| | | for (let i = 0; i < 1; i++) {
|
| | | const inputData = this.jsonData[i].filter(item => item.type === '0').map(item => {
|
| | | return { value: item.value };
|
| | | });
|
| | |
|
| | | const values = inputData.map(item => item.value);
|
| | | const values = [this.jsonData[0][3].button.value]
|
| | |
|
| | | data.push(values);
|
| | | }
|
| | | data.push([], [], [],[],[],[]);
|
| | | |
| | | data.unshift([], [], [],[],[],[],[]);
|
| | |
|
| | |
|
| | |
|
| | |
| | | if (currentButtonName === 'A02启动' || currentButtonName === 'A02 Start') {
|
| | | const data = [];
|
| | |
|
| | | for (let i = 1; i < 2; i++) {
|
| | | const inputData = this.jsonData[i].filter(item => item.type === '0').map(item => {
|
| | | return { value: item.value };
|
| | | });
|
| | | const values = [this.jsonData[1][3].button.value]
|
| | |
|
| | | const values = inputData.map(item => item.value);
|
| | | data.unshift([]);
|
| | | data.push(values);
|
| | | }
|
| | | data.push([], [], [],[],[]);
|
| | | data.push(values);
|
| | | |
| | | data.unshift([], [], [],[],[],[],[],[]);
|
| | |
|
| | |
|
| | |
|
| | | const jsonObject = { data };
|
| | | const jsonObject = { data };
|
| | |
|
| | | // 提交数据到后端
|
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | | // 提交数据到后端
|
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | |
|
| | | }
|
| | |
|
| | | if (currentButtonName === 'B01启动' || currentButtonName === 'B01 Start') {
|
| | | const data = [];
|
| | |
|
| | | for (let i = 2; i < 3; i++) {
|
| | | const inputData = this.jsonData[i].filter(item => item.type === '0').map(item => {
|
| | | return { value: item.value };
|
| | | });
|
| | | const values = [this.jsonData[2][3].button.value]
|
| | |
|
| | | const values = inputData.map(item => item.value);
|
| | | data.unshift([], []);
|
| | | data.push(values);
|
| | | }
|
| | | //data.unshift([]);
|
| | |
|
| | | data.push([], [], [],[]);
|
| | | data.push(values);
|
| | | |
| | | data.unshift([], [], [],[],[],[],[],[],[]);
|
| | |
|
| | |
|
| | | const jsonObject = { data };
|
| | |
|
| | | // 提交数据到后端
|
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | | const jsonObject = { data };
|
| | |
|
| | | // 提交数据到后端
|
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | |
|
| | | }
|
| | |
|
| | | if (currentButtonName === 'B02启动' || currentButtonName === 'B02 Start') {
|
| | | const data = [];
|
| | |
|
| | | for (let i = 3; i < 4; i++) {
|
| | | const inputData = this.jsonData[i].filter(item => item.type === '0').map(item => {
|
| | | return { value: item.value };
|
| | | });
|
| | | const values = [this.jsonData[3][3].button.value]
|
| | |
|
| | | const values = inputData.map(item => item.value);
|
| | | data.unshift([], [], []);
|
| | | data.push(values);
|
| | | }
|
| | |
|
| | | data.push([], [],[]);
|
| | | data.push(values);
|
| | | |
| | | data.unshift([], [], [],[],[],[],[],[],[],[]);
|
| | |
|
| | |
|
| | |
|
| | | const jsonObject = { data };
|
| | | const jsonObject = { data };
|
| | |
|
| | | // 提交数据到后端
|
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | | // 提交数据到后端
|
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | |
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | let obj = JSON.parse(msg.data);
|
| | | // console.log(obj);
|
| | | // console.log(obj);
|
| | | const jsonData2 = this.jsonData;
|
| | | const weihuiling = obj.weihuiling;
|
| | | const handleMouseMove = throttle(function (event) {
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | //更新实时位置
|
| | | jsonData2.forEach((item) => {
|
| | | |
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | }
|
| | | }, 50);
|
| | |
|
| | | document.addEventListener('mouseover', handleMouseMove);
|
| | |
|
| | |
|
| | | if(obj.zuhe1){
|
| | |
|
| | |
|
| | | //更新实时位置
|
| | | jsonData2.forEach((item) => {
|
| | | item.forEach((subItem) => {
|
| | | if (subItem.sending === 4) {
|
| | | subItem.value = obj.shishi1[0][0];
|
| | |
| | | for (let j = 2; j < arr2.length; j++) {
|
| | | let obj3 = arr2[j];
|
| | | if (obj3.button) {
|
| | | if (obj3.button && (obj3.button.name === "未回零" || obj3.button.name === "NotZero")) {
|
| | | if (obj3.button && (obj3.button.name === "未回零" || obj3.button.name === "NotZero" || obj3.button.name === "已回零" || obj3.button.name === "Zero")) {
|
| | | obj3.button.value = weihuiling[0][i];
|
| | | // console.log(obj3.button.value)
|
| | | }
|
| | |
| | | }
|
| | |
|
| | |
|
| | | //改变未回零文字
|
| | | 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.button && obj.button.value===1) {
|
| | | if ( obj.button.name==="未回零" && this.language==="zh-CN") {
|
| | | obj.button.name =obj.button.name.replace("未回零","已回零") ;
|
| | | }
|
| | | if ( obj.button.name==="NotZero") {
|
| | | obj.button.name =obj.button.name.replace("NotZero","Zero") ;
|
| | | }
|
| | | }
|
| | | if (obj.button && obj.button.value===0) {
|
| | | if ( obj.button.name==="已回零"&& this.language==="zh-CN") {
|
| | | obj.button.name =obj.button.name.replace("已回零","未回零") ;
|
| | | }
|
| | | if ( obj.button.name==="Zero") {
|
| | | obj.button.name =obj.button.name.replace("Zero","NotZero") ;
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | | }, 200);
|
| | |
|
| | | document.addEventListener('mouseover', handleMouseMove);
|
| | | };
|
| | |
|
| | |
|
| | |
| | |
|
| | | background-color: green;
|
| | | }
|
| | | .error-button3{
|
| | | background-color: green;
|
| | |
|
| | | }
|
| | | </style> |