Commit f3a846f8a07f543fc7dfac4befce03aa024fd341

Authored by ww
1 parent 990fecce

fix: 修复控制组件4只能绑定modbus设备

... ... @@ -228,13 +228,23 @@ export const commonDataSourceSchemas = (): FormSchema[] => {
228 228 deviceProfileId,
229 229 deviceType,
230 230 });
231   - if (data)
232   - return data.map((item) => ({
  231 + if (data) {
  232 + const result = data.map((item) => ({
233 233 ...item,
234 234 label: item.alias || item.name,
235 235 value: item.tbDeviceId,
236 236 deviceType: item.deviceType,
237 237 }));
  238 +
  239 + if (
  240 + unref(selectWidgetKeys).componentKey ===
  241 + ControlComponentEnum.LATERAL_NUMERICAL_CONTROL
  242 + ) {
  243 + return result.filter((item) => item.codeType === TaskTypeEnum.MODBUS_RTU);
  244 + }
  245 +
  246 + return result;
  247 + }
238 248 } catch (error) {}
239 249 }
240 250 return [];
... ...