zouyu
2023-09-11 6e367e4dc24da9085fc93556ee3a778119adebd9
src/components/view/standard.vue
@@ -20,7 +20,7 @@
          node-key="id" :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current>
          <div class="custom-tree-node" slot-scope="{ node, data }">
            <span><i :class="`node_i ${data.code != '[5]' ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i>
              {{ data.name }}</span>
              {{ data.code }}{{ data.name }}</span>
            <el-button type="text" size="mini" @click.stop="remove(node, data)">
              <i class="el-icon-delete"></i>
            </el-button>
@@ -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树数据结构
@@ -119,8 +115,8 @@
  //   }
  // },
  mounted() {
    this.tableType=0
    this.selectMaterialTree()
    // this.selectAll()
    this.selectVersion()
  },
  methods: {
@@ -155,7 +151,6 @@
    TYPE(val) {//类型.数据
      console.log(val);
      this.typeselect = val
      // console.log(this.typeselect);
      this.selectVersion()
    },
@@ -163,8 +158,8 @@
      console.log(val);
      this.returntree = val
    },
    selectVersion() {//版本
      this.$axios.get(this.$api.url.selectVersion, {
    async selectVersion() {//版本
      let v=await this.$axios.get(this.$api.url.selectVersion, {
        params: {
          specificationsId: this.returntree.id,
          type: this.typeselect,
@@ -174,8 +169,13 @@
        this.version = this.verdata.map(el => {
          return el = `v${el}`
        })
        console.log(this.verdata);
        // console.log("版本");
        return this.verdata[0]
      })
      this.character=v
      this.VER="v"+v
      console.log(this.character);
      this.selectAll()
    },
    //右侧数据
    selectAll() {
@@ -187,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);
@@ -205,7 +212,7 @@
    },
    //五级树
    selectMaterialTree() {
      this.$axios.get(this.$api.url.selectTreeByMaterial).then(res => {
      this.$axios.get(this.$api.url.selectTreeByMaterial).then( res => {
        this.list = res.data
        this.list.forEach((el, idx, arr) => {
          if (idx == 0) {