Browse Source

远程配置表格序号重塑

Xiahai 2 years ago
parent
commit
738caae817
1 changed files with 9 additions and 0 deletions
  1. 9 0
      src/views/iot/operate/remoteconf/index.vue

+ 9 - 0
src/views/iot/operate/remoteconf/index.vue

@@ -224,6 +224,15 @@ export default defineComponent({
         .then((res: any) => {
           if (res.remoteconf) {
             tableData.data = res.remoteconf.slice(1)
+            // 重塑编号
+            for (let i = 0; i < tableData.data.length; i++) {
+              if ((i + 1) < 10) {
+                tableData.data[i].configNumber = '0' + (i + 1);
+              } else {
+                tableData.data[i].configNumber = i + 1;
+              }
+            }
+            console.log(tableData.data);
             currentConfig.value = res.remoteconf[0]
             mirrorRef.value.setValue(currentConfig.value.configContent)
           }