wanshenmean
13 小时以前 f288ccc545f8cc32bc922c96dfb3cab9a1f92ec6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<template>
  <view-grid
    ref="grid"
    :columns="columns"
    :detail="detail"
    :editFormFields="editFormFields"
    :editFormOptions="editFormOptions"
    :searchFormFields="searchFormFields"
    :searchFormOptions="searchFormOptions"
    :table="table"
    :extend="extend"
  >
  </view-grid>
</template>
 
<script>
import extend from "@/extension/taskinfo/robotState.jsx";
import { ref, defineComponent } from "vue";
 
export default defineComponent({
  setup() {
    const table = ref({
      key: "Id",
      footer: "Foots",
      cnName: "机械手状态管理",
      name: "robotState",
      url: "/robotState/",
      sortName: "IPAddress",
    });
 
    // 编辑表单字段
    const editFormFields = ref({
      IPAddress: "",
      Version: "",
      IsEventSubscribed: false,
      RobotRunMode: "",
      RobotControlMode: "",
      RobotArmObject: "",
      Homed: "",
      CurrentAction: "",
      OperStatus: "",
      RobotTaskTotalNum: 0,
      IsSplitPallet: false,
      IsGroupPallet: false,
      IsInFakeBatteryMode: false,
      CurrentBatchIndex: 1,
      ChangePalletPhase: 0,
      IsScanNG: false,
      BatteryArrived: false,
    });
 
    // 编辑表单配置
    const editFormOptions = ref([
      [
        { title: "IP地址", field: "IPAddress", type: "string", readonly: true },
        { title: "版本号", field: "Version", type: "int", readonly: true },
      ],
      [
        {
          title: "运行模式",
          field: "RobotRunMode",
          type: "select",
          data: [
            { key: 1, value: "手动模式" },
            { key: 2, value: "自动模式" },
          ],
        },
        {
          title: "控制模式",
          field: "RobotControlMode",
          type: "select",
          data: [
            { key: 1, value: "客户端控制" },
            { key: 2, value: "其他" },
          ],
        },
        {
          title: "手臂状态",
          field: "RobotArmObject",
          type: "select",
          data: [
            { key: 0, value: "空闲" },
            { key: 1, value: "有物料" },
          ],
        },
      ],
      [
        { title: "回零状态", field: "Homed", type: "string" },
        { title: "当前动作", field: "CurrentAction", type: "string" },
        { title: "运行状态", field: "OperStatus", type: "string" },
      ],
      [
        { title: "任务总数", field: "RobotTaskTotalNum", type: "int" },
        { title: "当前批次", field: "CurrentBatchIndex", type: "int" },
        { title: "换盘阶段", field: "ChangePalletPhase", type: "int" },
      ],
      [
        {
          title: "是否拆盘",
          field: "IsSplitPallet",
          type: "checkbox",
        },
        {
          title: "是否组盘",
          field: "IsGroupPallet",
          type: "checkbox",
        },
        {
          title: "假电芯模式",
          field: "IsInFakeBatteryMode",
          type: "checkbox",
        },
      ],
      [
        {
          title: "是否扫码NG",
          field: "IsScanNG",
          type: "checkbox",
        },
        {
          title: "电芯是否到位",
          field: "BatteryArrived",
          type: "checkbox",
        },
        {
          title: "消息已订阅",
          field: "IsEventSubscribed",
          type: "checkbox",
        },
      ],
    ]);
 
    // 搜索表单字段
    const searchFormFields = ref({
      IPAddress: "",
      CurrentAction: "",
      OperStatus: "",
    });
 
    // 搜索表单配置
    const searchFormOptions = ref([
      [
        { title: "IP地址", field: "IPAddress", type: "string" },
        { title: "当前动作", field: "CurrentAction", type: "string" },
        { title: "运行状态", field: "OperStatus", type: "string" },
      ],
    ]);
 
    // 列定义
    const columns = ref([
      { field: "IPAddress", title: "IP地址", type: "string", width: 140, align: "left" },
      { field: "Version", title: "版本", type: "int", width: 80, align: "left" },
      { field: "RobotRunMode", title: "运行模式", type: "int", width: 100, bind: { key: "robotRunMode", data: [] }, align: "center" },
      { field: "RobotControlMode", title: "控制模式", type: "int", width: 100, bind: { key: "robotControlMode", data: [] }, align: "center" },
      { field: "RobotArmObject", title: "手臂状态", type: "int", width: 90, bind: { key: "robotArmObject", data: [] }, align: "center" },
      { field: "Homed", title: "回零状态", type: "string", width: 100, align: "center" },
      { field: "CurrentAction", title: "当前动作", type: "string", width: 100, align: "center" },
      { field: "OperStatus", title: "运行状态", type: "string", width: 100, align: "center" },
      { field: "RobotTaskTotalNum", title: "任务总数", type: "int", width: 90, align: "center" },
      { field: "IsSplitPallet", title: "拆盘", type: "byte", width: 60, align: "center" },
      { field: "IsGroupPallet", title: "组盘", type: "byte", width: 60, align: "center" },
      { field: "IsInFakeBatteryMode", title: "假电芯", type: "byte", width: 70, align: "center" },
      { field: "CurrentBatchIndex", title: "批次", type: "int", width: 60, align: "center" },
      { field: "ChangePalletPhase", title: "换盘阶段", type: "int", width: 80, align: "center" },
      { field: "IsScanNG", title: "扫码NG", type: "byte", width: 80, align: "center" },
      { field: "BatteryArrived", title: "电芯到位", type: "byte", width: 80, align: "center" },
      { field: "IsEventSubscribed", title: "已订阅", type: "byte", width: 70, align: "center" },
    ]);
 
    const detail = ref({});
 
    return {
      table,
      columns,
      detail,
      editFormFields,
      editFormOptions,
      searchFormFields,
      searchFormOptions,
      extend,
    };
  },
});
</script>