소스 검색

转换映射点表设置

liujiejie 1 년 전
부모
커밋
3433bbe959
1개의 변경된 파일92개의 추가작업 그리고 54개의 파일을 삭제
  1. 92 54
      src/views/dataAdministration/index.vue

+ 92 - 54
src/views/dataAdministration/index.vue

@@ -60,6 +60,10 @@
         :cell-style="rowStyle"
         stripe
         style="width: 100%"
+        :row-key="(row) => row.uniqueCode"
+        lazy
+        :load="load"
+        :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
       >
         <!-- Table Columns -->
         <el-table-column
@@ -167,45 +171,48 @@
           min-width="150"
         >
           <template slot-scope="scope">
-            <el-button
-              v-if="
-                scope.row.transferState !== -1 &&
-                (scope.row.transferAddr !== null ||
-                  scope.row.transferAddr !== '')
-              "
-              v-hasPermi="['dataManage:dataAdministration:edit']"
-              @click="handleEdit(scope.row)"
-              type="text"
-              size="small"
-              >编辑</el-button
-            >
-            <el-button
-              @click="handleClick(scope.row.downloadUrl)"
-              type="text"
-              size="small"
-              >下载</el-button
-            >
-            <el-button
-              v-if="
-                scope.row.transferState == -1 &&
-                (scope.row.transferAddr === null ||
-                  scope.row.transferAddr === '')
-              "
-              v-hasPermi="['dataManage:dataAdministration:editState']"
-              @click="editTransferState(scope.row, '转换')"
-              type="text"
-              size="small"
-              >转换</el-button
-            >
-            <el-button
-              v-else
-              @click="editTransferState(scope.row, '重新转换')"
-              type="text"
-              size="small"
-              v-hasPermi="['dataManage:dataAdministration:editState']"
-              :disabled="scope.row.transferState == 0"
-              >重新转换</el-button
-            >
+            <div v-if="scope.row.transferType">
+              <el-button
+                v-if="
+                  scope.row.transferState !== -1 &&
+                  (scope.row.transferAddr !== null ||
+                    scope.row.transferAddr !== '')
+                "
+                v-hasPermi="['dataManage:dataAdministration:edit']"
+                @click="handleEdit(scope.row)"
+                type="text"
+                size="small"
+                >编辑</el-button
+              >
+              <el-button
+                @click="handleClick(scope.row.downloadUrl)"
+                type="text"
+                size="small"
+                >下载</el-button
+              >
+              <el-button
+                v-if="
+                  scope.row.transferState == -1 &&
+                  (scope.row.transferAddr === null ||
+                    scope.row.transferAddr === '')
+                "
+                v-hasPermi="['dataManage:dataAdministration:editState']"
+                @click="editTransferState(scope.row, '转换')"
+                type="text"
+                size="small"
+                >转换</el-button
+              >
+              <el-button
+                v-else
+                @click="editTransferState(scope.row, '重新转换')"
+                type="text"
+                size="small"
+                v-hasPermi="['dataManage:dataAdministration:editState']"
+                :disabled="scope.row.transferState == 0"
+                >重新转换</el-button
+              >
+            </div>
+            <div v-else>/</div>
           </template>
         </el-table-column>
       </el-table>
@@ -268,7 +275,7 @@
                   >
                     <i class="el-icon-question"></i>
                   </el-tooltip>
-                  {{ item.transferTypeName + ":" }}
+                  {{ item.transferTypeName + "路径" + ":" }}
                 </span>
                 <el-input
                   :min="1"
@@ -281,7 +288,7 @@
             </el-col>
             <el-col :span="13">
               <el-form-item
-                :label="item.timeGranularityName + ':'"
+                :label="item.transferTypeName + '时间粒度' + ':'"
                 :prop="'timeGranularity_' + index"
                 :rules="getTimeGranularityRules(index)"
               >
@@ -289,7 +296,7 @@
                   type="number"
                   :min="1"
                   v-model="item.timeGranularity"
-                  :placeholder="'请输入' + item.timeGranularityName"
+                  :placeholder="'请输入' + item.transferTypeName"
                   size="small"
                   @input="ensureMinValue(item, 'timeGranularity')"
                 >
@@ -351,7 +358,9 @@
                   </el-tooltip>
                   {{
                     newEditForm.dataTransferTypePathDtoList[0]
-                      .transferTypeName + ":"
+                      .transferTypeName +
+                    "路径" +
+                    ":"
                   }}
                 </span>
                 <!-- :rules="{
@@ -378,16 +387,16 @@
             <el-col :span="13">
               <el-form-item
                 :label="
-                  newEditForm.dataTransferTypePathDtoList[0]
-                    .timeGranularityName + ':'
+                  newEditForm.dataTransferTypePathDtoList[0].transferTypeName +
+                  '时间粒度' +
+                  ':'
                 "
                 prop="dataTransferTypePathDtoList.0.timeGranularity"
                 :rules="{
                   required: true,
                   message:
                     '请输入' +
-                    newEditForm.dataTransferTypePathDtoList[0]
-                      .timeGranularityName,
+                    newEditForm.dataTransferTypePathDtoList[0].transferTypeName,
                   trigger: 'blur',
                 }"
               >
@@ -399,8 +408,7 @@
                   "
                   :placeholder="
                     '请输入' +
-                    newEditForm.dataTransferTypePathDtoList[0]
-                      .timeGranularityName
+                    newEditForm.dataTransferTypePathDtoList[0].transferTypeName
                   "
                   size="small"
                 >
@@ -478,7 +486,7 @@
                   >
                     <i class="el-icon-question"></i>
                   </el-tooltip>
-                  {{ editTransferStateForm.transferTypeName + ":" }}
+                  {{ editTransferStateForm.transferTypeName + "路径" + ":" }}
                 </span>
                 <el-input
                   v-model="editTransferStateForm.dataTransferTypePath"
@@ -632,6 +640,20 @@ export default {
     this.getBatchCodeList();
   },
   methods: {
+    load(tree, treeNode, resolve) {
+      console.log(tree, "tree");
+      const { batchCode } = tree; // 假设每行都有唯一的 id
+      // 调用接口获取子级数据
+      queryDataTransferByBatchCode({ batchCode })
+        .then((data) => {
+          console.log(data, "data");
+          resolve(data.data);
+        })
+        .catch((error) => {
+          console.error("Failed to load child nodes", error);
+          resolve([]); // 确保 resolve 被调用
+        });
+    },
     handleCloses(done) {
       this.$confirm("确认关闭?")
         .then((_) => {
@@ -746,6 +768,10 @@ export default {
             windCode: this.forPltFrom.fieldCode,
           });
         });
+      } else {
+        this.$nextTick(() => {
+          this.$refs.forPltRef.reset("fromPlt");
+        });
       }
     },
     handleEdit(row) {
@@ -921,11 +947,17 @@ export default {
     async getTableList() {
       try {
         this.loading = true;
-        const result = await queryDataTransferList({
+        const result = await queryDataTransferGroup({
           ...this.formInline,
           totalSize: undefined,
         });
-        this.tableData = result.data.list;
+        this.tableData = result.data.list.map((item) => {
+          return {
+            ...item,
+            hasChildren: true,
+            children: [],
+          };
+        });
         this.formInline.totalSize = result.data.totalSize;
         this.loading = false;
       } catch (error) {
@@ -985,11 +1017,17 @@ export default {
 
     async fetchData() {
       try {
-        const result = await queryDataTransferList({
+        const result = await queryDataTransferGroup({
           ...this.formInline,
           totalSize: undefined,
         });
-        this.tableData = result.data.list;
+        this.tableData = result.data.list.map((item) => {
+          return {
+            ...item,
+            hasChildren: true,
+            children: [],
+          };
+        });
         this.formInline.totalSize = result.data.totalSize;
       } catch (error) {
         this.$message({