wu
2023-11-03 17b8d077f7efe3db20344987cdad9da9d9ab3de6
CanadaMes-ui/src/views/Electrical/Parameter.vue
@@ -39,7 +39,6 @@
let socket;
import LanguageMixin from '../../lang/LanguageMixin'
import { SelectPassword } from "../../api/home";
export default {
  name: "Parameter",
  mixins: [LanguageMixin],
@@ -79,9 +78,7 @@
  created () {
    this.initWebSocket();
    this.isButtonDisabled = true; 
  },
  methods: {
   
@@ -161,32 +158,9 @@
      }
    },
    send () {
      SelectPassword().then(res => {
 this.password = res.data.password;
});
    this.$prompt(this.$t('Are you sure to perform this operation?'), this.$t('prompt'), {
    inputType: 'password',
    inputPlaceholder: this.$t('Please enter the password'),
    confirmButtonText: this.$t('Yes'),
    cancelButtonText: this.$t('No'),
    type: 'warning'
  }).then(({ value }) => {
    if (this.password === value) {
      // 密码正确,执行相应操作
      this.messagepack.data = this.record.xyData.map((item) => parseInt(item.value2)); // 转换为整数数组
      //console.log(this.messagepack);
      socket?.send(JSON.stringify(this.messagepack));
    } else {
      this.$message.success(this.$t('Password error')); // 密码错误
    }
  }).catch(() => {
    this.$message({
      type: 'info',
      message: this.$t('Operation canceled')
    });
  });
    },
    handleChange (index, value) {
      this.record.xyData[index].value = value;