소스 검색

远程配置表格序号重塑

Xiahai 2 년 전
부모
커밋
738caae817
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  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)
           }