ZengTao
2023-09-07 36acd690614dd276428530a59f448c543bac52d4
Merge branch 'master' of http://10.153.19.150:10101/r/CanadaMes
8个文件已修改
166 ■■■■ 已修改文件
CanadaMes-ui/src/lang/locales/en-US.json 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/zh-CN.json 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Action.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Parameter.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Sign.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/State.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/alarm.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/en-US.json
@@ -121,5 +121,53 @@
    "添加角色成功": "Successfully added role",
    "更新状态成功": "Successfully updated status",
    "修改角色成功": "Successfully modified role",
    "删除角色成功": "Successfully deleted role"
  "删除角色成功": "Successfully deleted role",
  "translation": {
    "D01 VFD error": "D01 VFD error",
    "D02 VFD error": "D02 VFD error",
    "D03 VFD error": "D03 VFD erro",
    "D04 VFD error": "D04 VFD error",
    "D05 VFD error": "D05 VFD error",
    "D06 VFD error": "D06 VFD error",
    "B01 VFD error": "B01 VFD error",
    "B02 VFD error": "B02 VFD error",
    "A01 VFD error": "A01 VFD error",
    "A02 VFD error": "A02 VFD error",
    "A01 servo turn error": "A01 servo turn error",
    "A02 servo turn error": "A02 servo turn error",
    "A01 servo travel error": "A01 servo travel error",
    "A02 servo travel error": "A02 servo travel error",
    "B01 servo travel error": "B01 servo travel error",
    "B02 servo travel error": "B02 servo travel error",
    "D01 DEC error": "D01 DEC error",
    "D01 pos error": "D01 pos error",
    "D02 DEC error": "D02 DEC error",
    "D02 pos error": "D02 pos error",
    "D03 DEC error": "D03 DEC error",
    "D03 pos error": "D03 pos error",
    "D04 DEC error": "D04 DEC error",
    "D04 pos error": "D04 pos error",
    "D05 DEC error": "D05 DEC error",
    "D05 pos error": "D05 pos error",
    "D06 DEC error": "D06 DEC error",
    "D06 pos error": "D06 pos error",
    "A01 DEC error": "A01 DEC error",
    "A01 pos error": "A01 pos error",
    "A02 DEC error": "A02 DEC error",
    "A02 pos error": "A02 pos error",
    "B01 IN DEC error": "B01 IN DEC error",
    "B01 IN pos error": "B01 IN pos error",
    "B01 OUT DEC error": "B01 OUT DEC error",
    "B01 OUT pos error": "B01 OUT pos error",
    "B02 IN DEC error": "B02 IN DEC error",
    "B02 IN pos error": "B02 IN pos error",
    "B02 OUT DEC error": "B02 OUT DEC error",
    "B02 OUT pos error": "B02 OUT pos error"
  },
  "Parameter": "Parameter",
  "Action": "Action",
  "Sign": "Sign",
  "State": "State",
  "Alarm": "Alarm",
  "Distribute": "Distribute"
  }
CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -1,4 +1,3 @@
  {
    "systemTitle": "登录系统",
    "usernamePlaceholder": "请输入用户名",
@@ -31,8 +30,6 @@
  "langPassword": "密码",
  "langState": "状态",
  "langSelect": "请选择",
  "langEditUserTitle": "修改用户",
  "northglassMESsystem":"北玻MES系统",
  "exit":"退出",
@@ -124,6 +121,53 @@
    "添加角色成功": "添加角色成功",
    "更新状态成功": "更新状态成功",
    "修改角色成功": "修改角色成功",
    "删除角色成功": "删除角色成功"
  "删除角色成功": "删除角色成功",
  "translation": {
    "D01 VFD error": "D01 VFD 错误",
    "D02 VFD error": "D02 VFD 错误",
    "D03 VFD error": "D03 VFD 错误",
    "D04 VFD error": "D04 VFD 错误",
    "D05 VFD error": "D05 VFD 错误",
    "D06 VFD error": "D06 VFD 错误",
    "B01 VFD error": "B01 VFD 错误",
    "B02 VFD error": "B02 VFD 错误",
    "A01 VFD error": "A01 VFD 错误",
    "A02 VFD error": "A02 VFD 错误",
    "A01 servo turn error": "A01 servo turn 错误",
    "A02 servo turn error": "A02 servo turn 错误",
    "A01 servo travel error": "A01 servo travel 错误",
    "A02 servo travel error": "A02 servo travel 错误",
    "B01 servo travel error": "B01 servo travel 错误",
    "B02 servo travel error": "B02 servo travel 错误",
    "D01 DEC error": "D01 DEC 错误",
    "D01 pos error": "D01 pos 错误",
    "D02 DEC error": "D02 DEC 错误",
    "D02 pos error": "D02 pos 错误",
    "D03 DEC error": "D03 DEC 错误",
    "D03 pos error": "D03 pos 错误",
    "D04 DEC error": "D04 DEC 错误",
    "D04 pos error": "D04 pos 错误",
    "D05 DEC error": "D05 DEC 错误",
    "D05 pos error": "D05 pos 错误",
    "D06 DEC error": "D06 DEC 错误",
    "D06 pos error": "D06 pos 错误",
    "A01 DEC error": "A01 DEC 错误",
    "A01 pos error": "A01 pos 错误",
    "A02 DEC error": "A02 DEC 错误",
    "A02 pos error": "A02 pos 错误",
    "B01 IN DEC error": "B01 IN DEC 错误",
    "B01 IN pos error": "B01 IN pos 错误",
    "B01 OUT DEC error": "B01 OUT DEC 错误",
    "B01 OUT pos error": "B01 OUT pos 错误",
    "B02 IN DEC error": "B02 IN DEC 错误",
    "B02 IN pos error": "B02 IN pos 错误",
    "B02 OUT DEC error": "B02 OUT DEC 错误",
    "B02 OUT pos error": "B02 OUT pos 错误"
  },
  "Parameter": "参数下发",
  "Action": "开关控制",
  "Sign": "IO状态",
  "State": "State",
  "Alarm": "报警信息",
  "Distribute": "下发"
  }
CanadaMes-ui/src/views/Electrical/Action.vue
@@ -3,7 +3,7 @@
    <!--面包屑导航区域-->
    <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
      <router-link to="/home" tag="el-button" type="text">{{ $t('langHome') }}</router-link>
      <el-button type="text">设备管理</el-button>
      <el-button type="text">Electrical</el-button>
      <router-link to="/Electrical/Parameter" tag="el-button" type="text">Parameter</router-link>
      <router-link to="/Electrical/Action" tag="el-button" type="text">Action</router-link>
      <router-link to="/Electrical/Sign" tag="el-button" type="text">Sign</router-link>
@@ -28,10 +28,11 @@
</template>
<script >
import LanguageMixin from '../../lang/LanguageMixin'
let socket;
export default {
  name: "action",
  mixins: [LanguageMixin],
  data () {
    return {
      record: {
@@ -192,13 +193,13 @@
}
.el-input__inner {
    border: 1 solid black;
  }
.in_mc {
.in_mc {}
 
}
.el-input__inner {
    border: none;
  }
CanadaMes-ui/src/views/Electrical/Parameter.vue
@@ -3,7 +3,7 @@
  <!--面包屑导航区域-->
  <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
  <router-link to="/home" tag="el-button" type="text">{{ $t('langHome') }}</router-link>
  <el-button type="text">设备管理</el-button>
      <el-button type="text">{{ $t('Distribute') }}</el-button>
  <router-link to="/Electrical/Parameter" tag="el-button" type="text">Parameter</router-link>
  <router-link to="/Electrical/Action" tag="el-button" type="text">Action</router-link>
  <router-link to="/Electrical/Sign" tag="el-button" type="text">Sign</router-link>
@@ -14,21 +14,25 @@
  
  <el-form label-width="100px" style="display: flex;flex-wrap: wrap;" :model="messagepack.data">
    <div id="btn_div">
      <el-button type="primary" @click="send()">下发参数</el-button>
        <el-button type="primary" @click="send()">{{ $t('Distribute') }}</el-button>
    </div>
    <div class="kuai_div" v-for="(item, index) in record.xyData" :key="index">
      <el-input style="width: 280px;" class="in_mc" v-model="item.name" readonly></el-input>
      <el-input v-model.number="item.value" style="width: 80px;" @input="handleChange(index, $event.target.value)"></el-input>
        <el-input v-model.number="item.value" style="width: 80px;"
          @input="handleChange(index, $event.target.value)"></el-input>
    </div>
  </el-form>
  </div>
  </template>
  
  <script>
import LanguageMixin from '../../lang/LanguageMixin'
  let socket;
  
  export default {
  name: "Parameter",
  mixins: [LanguageMixin],
  data() {
  return {
  record: {
CanadaMes-ui/src/views/Electrical/Sign.vue
@@ -3,7 +3,7 @@
    <!--面包屑导航区域-->
    <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
      <router-link to="/home" tag="el-button" type="text">{{ $t('langHome') }}</router-link>
      <el-button type="text">设备管理</el-button>
      <el-button type="text">Electrical</el-button>
      <router-link to="/Electrical/Parameter" tag="el-button" type="text">Parameter</router-link>
      <router-link to="/Electrical/Action" tag="el-button" type="text">Action</router-link>
      <router-link to="/Electrical/Sign" tag="el-button" type="text">Sign</router-link>
CanadaMes-ui/src/views/Electrical/State.vue
@@ -3,7 +3,7 @@
    <!--面包屑导航区域-->
    <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
      <router-link to="/home" tag="el-button" type="text">{{ $t('langHome') }}</router-link>
      <el-button type="text">设备管理</el-button>
      <el-button type="text">Electrical</el-button>
      <router-link to="/Electrical/Parameter" tag="el-button" type="text">Parameter</router-link>
      <router-link to="/Electrical/Action" tag="el-button" type="text">Action</router-link>
      <router-link to="/Electrical/Sign" tag="el-button" type="text">Sign</router-link>
CanadaMes-ui/src/views/Electrical/alarm.vue
@@ -3,7 +3,7 @@
    <!--面包屑导航区域-->
    <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
      <router-link to="/home" tag="el-button" type="text">{{ $t('langHome') }}</router-link>
      <el-button type="text">设备管理</el-button>
      <el-button type="text">Electrical</el-button>
      <router-link to="/Electrical/Parameter" tag="el-button" type="text">Parameter</router-link>
      <router-link to="/Electrical/Action" tag="el-button" type="text">Action</router-link>
      <router-link to="/Electrical/Sign" tag="el-button" type="text">Sign</router-link>
@@ -18,7 +18,7 @@
        </div>
      </el-form> -->
    <el-table :data="tableData" style="width: 100%;" height="590">
    <el-table :data="localizedRoles" style="width: 100%;" height="590">
      <el-table-column prop="id" label="id" width="80">
      </el-table-column>
      <el-table-column prop="content" label="content">
@@ -33,9 +33,11 @@
<script >
import { setAll } from "../../api/alarm";
import LanguageMixin from '../../lang/LanguageMixin'
let socket;
export default {
  name: "alarm",
  mixins: [LanguageMixin],
  data () {
    return {
      record: {
@@ -44,8 +46,8 @@
        // xyData: [],
      },
      tableData: [],
      roles: [],
      localizedRoles: [],
      messagepack: {
        data: { taskname: "" }
      },
@@ -59,15 +61,28 @@
  created () {
    this.init();
    this.load();
  },
  methods: {
    load () {
      setAll().then(res => {
        this.tableData = res.data.list;
        //console.log(this.tableData);
        this.roles = res.data.list;
        const language = this.$i18n.locale;
        if (language === 'zh-CN') {
          this.replaceChineseWithEnglish();
        } else {
          this.localizedRoles = [...this.roles];
        }
        console.log(this.localizedRoles);
      });
    },
    replaceChineseWithEnglish () {
      const translation = this.$t('translation');
      this.localizedRoles = this.roles.map(role => ({
        ...role,
        content: translation[role.content] || role.content
      }));
    },
    init () {
      let viewname = "alarm";
springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java
@@ -33,21 +33,19 @@
        }
    }
    private void sendMessages() {
        WebSocketServer sendwServer = WebSocketServer.sessionMap.get("action");
        if (sendwServer != null) {
            List<Boolean> paramlist = S7control.getinstance().ReadBits("DB100.DBW", 12);
            //        new short[]{1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0}
      // new short[]{1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
      // 1, 0}
            JSONObject jsonObject = new JSONObject();
            jsonObject.append("params", new short[]{1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0});
      jsonObject.append("params",
          new short[] { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 });
            sendwServer.sendMessage(jsonObject.toString());
        }
    }