xiazhengtongxue
8 天以前 cbfc5ac3c45eff75e912ba6aeaad83533a1a4296
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<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/robotTask.js";
import { ref, defineComponent } from "vue";
 
export default defineComponent({
  setup() {
    const table = ref({
      key: "robotTaskId",           // 主键字段名
      footer: "Foots",
      cnName: "机器人任务信息",      // 中文名称
      name: "robotTask",            // 表名
      url: "/robotTask/",           // API路径
      sortName: "createDate",       // 默认排序字段
    });
 
    // 编辑表单字段(初始为空,根据实际编辑需求配置)
    const editFormFields = ref({});
    const editFormOptions = ref([]);
 
    // 搜索表单字段
    const searchFormFields = ref({
      robotTaskNum: "",
      robotRoadway: "",
      robotTaskType: "",
      robotTaskState: "",
      robotSourceAddress: "",
      robotTargetAddress: "",
      creater: "",
      createDate: "",
    });
 
    // 搜索表单配置
    const searchFormOptions = ref([
      [
        { title: "任务编号", field: "robotTaskNum", type: "int" },
        { title: "巷道", field: "robotRoadway", type: "like" },
        {
          title: "任务类型",
          field: "robotTaskType",
          type: "selectList",
          dataKey: "taskType",
          data: [],
        },
        {
          title: "任务状态",
          field: "robotTaskState",
          type: "selectList",
          dataKey: "taskState",
          data: [],
        },
      ],
      [
        { title: "来源地址", field: "robotSourceAddress", type: "like" },
        { title: "目标地址", field: "robotTargetAddress", type: "like" },
        { title: "创建人", field: "creater", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
      ],
    ]);
 
    // 列配置
    const columns = ref([
      {
        field: "robotTaskId",
        title: "任务ID",
        type: "int",
        width: 90,
        hidden: true,        // 隐藏主键
        readonly: true,
        require: true,
        align: "left",
      },
      {
        field: "robotTaskNum",
        title: "任务编号",
        type: "int",
        width: 100,
        align: "left",
        sortable: true,      // 可排序
      },
      {
        field: "robotRoadway",
        title: "巷道",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "robotTaskType",
        title: "任务类型",
        type: "int",
        width: 100,
        align: "left",
        bind: { key: "taskType", data: [] },
      },
      {
        field: "robotTaskState",
        title: "任务状态",
        type: "int",
        width: 120,
        align: "left",
        bind: { key: "taskState", data: [] },
      },
      {
        field: "robotTaskTotalNum",
        title: "任务总数",
        type: "int",
        width: 90,
        align: "left",
      },
      {
        field: "robotSourceAddress",
        title: "来源地址",
        type: "string",
        width: 120,
        align: "left",
      },
      {
        field: "robotTargetAddress",
        title: "目标地址",
        type: "string",
        width: 120,
        align: "left",
      },
      {
        field: "robotSourceAddressLineCode",
        title: "来源线代码",
        type: "string",
        width: 130,
        align: "left",
      },
      {
        field: "robotTargetAddressLineCode",
        title: "目标线代码",
        type: "string",
        width: 130,
        align: "left",
        hidden: true,
      },
      {
        field: "robotSourceAddressPalletCode",
        title: "来源托盘代码",
        type: "string",
        width: 130,
        align: "left",
        hidden: true,
      },
      {
        field: "robotTargetAddressPalletCode",
        title: "目标托盘代码",
        type: "string",
        width: 130,
        align: "left",
        hidden: true,
      },
      {
        field: "robotExceptionMessage",
        title: "异常信息",
        type: "string",
        width: 200,
        align: "left",
        hidden: true,
        overflow: "ellipsis", 
      },
      {
        field: "robotGrade",
        title: "优先级",
        type: "int",
        width: 80,
        align: "left",
        bind: {
          key: "robotGrade",
          data: [
            { id: 1, name: "低" },
            { id: 2, name: "普通" },
            { id: 3, name: "高" },
            { id: 4, name: "紧急" },
          ],
        },
      },
      {
        field: "robotDispatchertime",
        title: "调度时间",
        type: "datetime",
        width: 160,
        align: "left",
      },
      {
        field: "robotremark",
        title: "备注",
        type: "string",
        width: 150,
        align: "left",
        hidden: true,
      },
      {
        field: "creater",
        title: "创建人",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "createDate",
        title: "创建时间",
        type: "datetime",
        width: 160,
        align: "left",
        sortable: true,
      },
      {
        field: "modifier",
        title: "修改人",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "modifyDate",
        title: "修改时间",
        type: "datetime",
        width: 160,
        align: "left",
      },
    ]);
 
    // 详情弹窗配置(如需查看详情功能)
    const detail = ref({
      cnName: "机器人任务详情",
      table: "robotTask",
      key: "robotTaskId",
      sortName: "CreateDate",
      columns: columns.value.filter(col => !col.hidden), // 使用非隐藏字段
    });
 
    return {
      table,
      extend,
      editFormFields,
      editFormOptions,
      searchFormFields,
      searchFormOptions,
      columns,
      detail,
    };
  },
});
</script>