Эх сурвалжийг харах

fix: 修复索引显示错误

cfofpp 5 сар өмнө
parent
commit
129ed9bd6a

+ 14 - 7
src/views/distributionnetwork/maintenance/line-info/index.vue

@@ -16,6 +16,12 @@
           placeholder="请输入"
         ></el-input>
       </el-form-item>
+      <el-form-item label="所属县公司" prop="stdCountyOrgNm">
+        <el-input
+          v-model="queryParams.stdCountyOrgNm"
+          placeholder="请输入"
+        ></el-input>
+      </el-form-item>
       <el-form-item>
         <el-button
           type="primary"
@@ -46,11 +52,7 @@
       >
         <el-table-column prop="" label="序号" width="80" align="center">
           <template slot-scope="scope">
-            {{
-              scope.$index +
-              (queryParams.pageNum - 1) * queryParams.pageSize +
-              1
-            }}
+            {{ scope.row.index }}
           </template>
         </el-table-column>
         <el-table-column
@@ -128,6 +130,7 @@ export default {
       queryParams: {
         lineNm: "",
         voltLvlDsc: "",
+        stdCountyOrgNm: "",
         pageNum: 1,
         pageSize: 10,
       },
@@ -149,8 +152,11 @@ export default {
     getList() {
       this.loading = true;
       selectCompleteList({ ...this.queryParams }).then((response) => {
-        this.dataList = response.rows.map((ite) => {
+        this.dataList = response.rows.map((ite, i) => {
           ite.hasChildren = true;
+          ite.children = [];
+          ite.index =
+            i + (this.queryParams.pageNum - 1) * this.queryParams.pageSize + 1;
           return ite;
         });
         this.total = response.total;
@@ -164,8 +170,9 @@ export default {
         blgBigFeederId: tree.feederId,
       });
       resolve(
-        data.rows.map((ite) => {
+        data.rows.map((ite, i) => {
           ite.id = Math.random();
+          ite.index = i + 1;
           return ite;
         })
       );