|
1 | | -<template> |
| 1 | +<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform"> |
2 | 2 | <v-card |
3 | 3 | elevation-15 |
4 | 4 | > |
5 | | - <back-button></back-button> |
6 | | - <v-card-title primary-title> |
7 | | - Tile Information |
8 | | - </v-card-title> |
9 | | - <v-container> |
| 5 | + <v-layout row> |
| 6 | + <back-button></back-button> |
| 7 | + <v-card-title primary-title> |
| 8 | + Tile Information |
| 9 | + </v-card-title> |
| 10 | +
|
| 11 | + </v-layout> |
| 12 | + <v-container py-1> |
10 | 13 | <v-layout |
11 | 14 | column |
12 | 15 | > |
13 | | - <v-select |
14 | | - v-model="section" |
15 | | - :items="sections" |
16 | | - attach |
17 | | - chips |
18 | | - label="Section" |
19 | | - ></v-select> |
20 | | - <v-select |
21 | | - v-model="comp" |
22 | | - :items="comps" |
23 | | - attach |
24 | | - chips |
25 | | - label="Component" |
26 | | - ></v-select> |
27 | | - <v-btn @click="setDeps">Choose</v-btn> |
| 16 | + <v-dialog v-model="dialog"> |
| 17 | + <template v-slot:activator="{ on }"> |
| 18 | + <v-btn |
| 19 | + color="red lighten-2" |
| 20 | + dark |
| 21 | + v-on="on" |
| 22 | + > |
| 23 | + Add |
| 24 | + </v-btn> |
| 25 | + </template> |
| 26 | + <v-card @keypress.enter="setDeps"> |
| 27 | + <v-container> |
| 28 | + <v-select |
| 29 | + v-model="section" |
| 30 | + :items="sections" |
| 31 | + attach |
| 32 | + chips |
| 33 | + label="Section" |
| 34 | + ></v-select> |
| 35 | + <v-select |
| 36 | + v-model="comp" |
| 37 | + :items="comps" |
| 38 | + attach |
| 39 | + chips |
| 40 | + label="Component" |
| 41 | + ></v-select> |
| 42 | + <v-layout row> |
| 43 | + <v-btn @click="setDeps">Choose</v-btn> |
| 44 | + <v-btn @click="dialog = false; section = ''; comp = ''">cancel</v-btn> |
| 45 | + </v-layout> |
| 46 | + </v-container> |
| 47 | + </v-card> |
| 48 | + </v-dialog> |
| 49 | + |
28 | 50 | <v-list> |
29 | 51 | <v-list-tile> |
30 | 52 | {{mesh.h[triClicked]}} |
|
52 | 74 | return { |
53 | 75 | section: '', |
54 | 76 | comp: '', |
55 | | - deps: [] |
| 77 | + deps: [], |
| 78 | + dialog: false, |
56 | 79 | } |
57 | 80 | }, |
58 | 81 | components: { |
|
75 | 98 | }, |
76 | 99 |
|
77 | 100 | data() { |
78 | | - console.log("in computed data ", this.deps) |
| 101 | + // console.log("in computed data ", this.deps) |
79 | 102 | let d = this.deps.map(({section, comp}) => this.$store.state[section][comp]) |
80 | | - console.log("data: ", d) |
| 103 | + // console.log("data: ", d) |
81 | 104 | return d |
82 | 105 | }, |
83 | 106 | display() { |
84 | | - console.log("in display") |
85 | | - return this.data.map(d => { |
| 107 | + // console.log("in display") |
| 108 | + return this.data.map((d,i) => { |
86 | 109 | console.log(d) |
87 | 110 | if (Array.isArray(d)) { |
88 | | - return d[this.triClicked] |
| 111 | + return (this.deps[i].comp) + ": \n " + d[this.triClicked] |
89 | 112 | } else { |
90 | | - return Object.keys(d).map(k => { |
91 | | - return Array.isArray(d[k]) ? d[k][this.triClicked] : 'not array' |
92 | | - }); |
| 113 | + const a = Object.keys(d).map(k => { |
| 114 | + return (Array.isArray(d[k]) ? d[k][this.triClicked] : 'not array') |
| 115 | + }) |
| 116 | + return (this.deps[i].comp) + ": \n " + a; |
93 | 117 | } |
94 | 118 | }); |
95 | 119 | }, |
96 | 120 | }, |
97 | 121 | methods: { |
98 | 122 | setDeps() { |
99 | | - console.log(this.section, this.comp) |
| 123 | + // console.log(this.section, this.comp) |
100 | 124 | let newDeps = {section: this.section, comp: this.comp} |
101 | | - console.log(newDeps) |
| 125 | + // console.log(newDeps) |
102 | 126 |
|
103 | 127 | this.deps.push(newDeps) |
104 | | - console.log(this.deps) |
105 | | -
|
| 128 | + // console.log(this.deps) |
| 129 | + this.dialog = false |
106 | 130 | this.section = '' |
107 | 131 | this.comp = '' |
108 | 132 | } |
|
0 commit comments