From 6e367e4dc24da9085fc93556ee3a778119adebd9 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 11 九月 2023 12:46:22 +0800
Subject: [PATCH] 	modified:   src/components/view/standard-table/material.vue 	new file:   src/components/view/standard-table/target.vue 	modified:   src/components/view/standard-table/technology.vue 	modified:   src/components/view/standard.vue

---
 src/components/view/standard.vue |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/src/components/view/standard.vue b/src/components/view/standard.vue
index d799745..d040ac1 100644
--- a/src/components/view/standard.vue
+++ b/src/components/view/standard.vue
@@ -55,17 +55,13 @@
         <div class="contentTable" v-if="this.typeselect == 0">
           <technology  :tableType="tableType" :tableData="tableData"></technology>
         </div>
-        <div v-if="this.typeselect == 1">鎶�鏈寚鏍�</div>
+        <div v-if="this.typeselect == 1">
+          <target :tableType="tableType" :tableData="tableData"></target>
+        </div>
         <div v-if="this.typeselect == 2">
           <material  :tableType="tableType" :tableData="tableData"></material>
         </div>
         <div v-if="this.typeselect == 3">鐢熶骇宸ヨ壓</div>
-        <!-- <div class="table">
-          <technology v-if="tableData.length !== 0" :tableType="tableType" :tableData="tableData"></technology>
-        </div> -->
-        <!-- <div class="table">
-          <technology v-if="tableData.length !== 0" :tableType="tableType" :tableData="tableData"></technology>
-        </div> -->
       </div>
     </div>
 
@@ -87,9 +83,9 @@
 <script>
 import technology from "./standard-table/technology.vue"
 import material from "./standard-table/material.vue"
+import target from "./standard-table/target.vue"
 export default {
-  components: { technology,material },
-
+  components: { technology,material,target },
   data() {
     return {
       // BOM鏍戞暟鎹粨鏋�
@@ -155,7 +151,6 @@
     TYPE(val) {//绫诲瀷.鏁版嵁
       console.log(val);
       this.typeselect = val
-
       // console.log(this.typeselect);
       this.selectVersion()
     },
@@ -192,11 +187,18 @@
         }
       }).then(res => {
         let arr = res.data;
-        for(var i=0;i<arr.length;i++){
-            arr[i].id = "0" + i;
-        }
+        this.formatData(arr)
         this.tableData = arr;
       })
+    },
+    formatData(data){
+      let arr = data;
+      for(var i=0;i<arr.length;i++){
+            arr[i].rowId = Math.random();
+            if(arr[i].children != undefined){
+              this.formatData(arr[i].children);
+            }
+        }
     },
     verevent(val) {
       console.log(val);
@@ -211,7 +213,7 @@
     //浜旂骇鏍�
     selectMaterialTree() {
       this.$axios.get(this.$api.url.selectTreeByMaterial).then( res => {
-        _that.list = res.data
+        this.list = res.data
         this.list.forEach((el, idx, arr) => {
           if (idx == 0) {
             arr[idx].name = '鎴愬搧'

--
Gitblit v1.9.3