|
@@ -129,8 +129,9 @@
|
|
const dataIndex = col.dataIndex as string;
|
|
const dataIndex = col.dataIndex as string;
|
|
// 获取到子设备编码的前缀及编码,正则例子:forcFan1 => [forcFan1, forcFan, 1]
|
|
// 获取到子设备编码的前缀及编码,正则例子:forcFan1 => [forcFan1, forcFan, 1]
|
|
const [_, pfx] = prefix.match(/([A-Za-z]+)([0-9]+)/) || [];
|
|
const [_, pfx] = prefix.match(/([A-Za-z]+)([0-9]+)/) || [];
|
|
- // 同时,如若已经配置了编号则不要更改
|
|
|
|
- if (dataIndex.search(/[0-9]/) !== -1) return col;
|
|
|
|
|
|
+ // 同时,如若已经在前缀后配置了编号则不要更改
|
|
|
|
+ const reg = new RegExp(`${pfx}[0-9]`);
|
|
|
|
+ if (dataIndex.search(reg) !== -1) return col;
|
|
if (dataIndex.includes(pfx)) {
|
|
if (dataIndex.includes(pfx)) {
|
|
return {
|
|
return {
|
|
...col,
|
|
...col,
|