Commit a95d2830c1d5176c7e5ac8058b856af4f19f73ae
1 parent
ebc8107ce5
Exists in
master
and in
3 other branches
add country select by given option and testing success work hit in api
Showing
7 changed files
with
586 additions
and
476 deletions
Show diff stats
src/components/questions/diet.vue
1 | 1 | <template> |
2 | -<v-container grid-list-xl> | |
3 | - <v-flex> | |
4 | - <v-card> | |
2 | + <v-flex> | |
3 | + <v-card> | |
5 | 4 | <v-spacer></v-spacer> |
6 | 5 | <v-dialog v-model="dialog" max-width="800px"> |
7 | - | |
8 | 6 | <v-card> |
9 | 7 | <v-card-title> |
10 | 8 | <span class="headline">{{ formTitle }}</span> |
... | ... | @@ -14,188 +12,210 @@ |
14 | 12 | <v-flex> |
15 | 13 | <v-card> |
16 | 14 | <v-card-text> |
17 | - <span> | |
18 | - <p><b>Ana Suggestion:</b> Select Suggestion</p></span> | |
19 | - <h5>Select Category:</h5> | |
20 | - <span> | |
21 | - <v-btn color="grey darken-2" flat>Suggestion</v-btn> | |
22 | - <v-btn color="grey darken-2" flat>Sex</v-btn> | |
23 | - <v-btn color="grey darken-2" flat>Health</v-btn> | |
24 | - <v-btn color="grey darken-2" flat>Skin & Beauty</v-btn> | |
25 | - <v-btn color="grey darken-2" flat>Diet & Ex</v-btn> | |
26 | - </span> | |
15 | + <span> | |
16 | + <p> | |
17 | + <b>Ana Suggestion:</b> Select Suggestion | |
18 | + </p> | |
19 | + </span> | |
20 | + <h5>Select Category:</h5> | |
21 | + <span> | |
22 | + <v-btn color="grey darken-2" flat>Suggestion</v-btn> | |
23 | + <v-btn color="grey darken-2" flat>Sex</v-btn> | |
24 | + <v-btn color="grey darken-2" flat>Health</v-btn> | |
25 | + <v-btn color="grey darken-2" flat>Skin & Beauty</v-btn> | |
26 | + <v-btn color="grey darken-2" flat>Diet & Ex</v-btn> | |
27 | + </span> | |
27 | 28 | </v-card-text> |
28 | - </v-card> | |
29 | + </v-card> | |
29 | 30 | </v-flex> |
30 | 31 | <v-card-text> |
31 | - | |
32 | - <v-container grid-list-md> | |
33 | - <v-layout wrap> | |
34 | - <v-flex xs12 sm6 md12> | |
35 | - <v-textarea | |
36 | - solo | |
37 | - v-model="AddQuestioncredentials.question" | |
38 | - name="input-7-4" | |
39 | - label="Type Question" | |
40 | - ></v-textarea> | |
41 | - </v-flex> | |
32 | + <v-container grid-list-md> | |
33 | + <v-layout wrap> | |
34 | + <v-flex xs12 sm6 md12> | |
35 | + <v-textarea | |
36 | + solo | |
37 | + v-model="AddQuestioncredentials.question" | |
38 | + name="input-7-4" | |
39 | + label="Type Question" | |
40 | + ></v-textarea> | |
41 | + </v-flex> | |
42 | 42 | </v-layout> |
43 | 43 | </v-container> |
44 | 44 | </v-card-text> |
45 | - | |
46 | 45 | <v-card-actions> |
47 | - <v-spacer></v-spacer> | |
48 | - <v-btn dark large @click.native="save">Post Question</v-btn> | |
46 | + <v-spacer></v-spacer> | |
47 | + <v-btn dark large @click.native="save">Post Question</v-btn> | |
49 | 48 | </v-card-actions> |
50 | - </v-card> | |
51 | - </v-dialog> | |
49 | + </v-card> | |
50 | + </v-dialog> | |
52 | 51 | |
53 | - | |
54 | - | |
55 | - <v-dialog v-model="dialog1" max-width="800px"> | |
52 | + <v-dialog v-model="dialog1" max-width="800px"> | |
56 | 53 | <v-card> |
57 | - <v-card-title> | |
58 | - <span class="headline">Edit Question</span> | |
59 | - <v-spacer></v-spacer> | |
60 | - <v-icon @click="close1">close</v-icon> | |
61 | - </v-card-title> | |
54 | + <v-card-title> | |
55 | + <span class="headline">Edit Question</span> | |
56 | + <v-spacer></v-spacer> | |
57 | + <v-icon @click="close1">close</v-icon> | |
58 | + </v-card-title> | |
62 | 59 | |
63 | - <v-card-text> | |
64 | - <v-layout wrap> | |
60 | + <v-card-text> | |
61 | + <v-layout wrap> | |
65 | 62 | <v-flex xs12 sm6 md12> |
66 | 63 | <v-text-field outline v-model="editedItem.ques" label="Question"></v-text-field> |
67 | 64 | </v-flex> |
68 | 65 | </v-layout> |
69 | - <span><p> <b>Ana suggestion:</b> Abnormal Uterine Bleeding <br> | |
70 | - Diagnosis 1,Diagnosis 2,Diagnosis 3 | |
71 | - <v-btn dark large @click.native="save1" style="position:absolute; top:163px; right:5px;">Save Edit</v-btn></p></span> | |
66 | + <span> | |
67 | + <p> | |
68 | + <b>Ana suggestion:</b> Abnormal Uterine Bleeding | |
69 | + <br>Diagnosis 1,Diagnosis 2,Diagnosis 3 | |
70 | + <v-btn | |
71 | + dark | |
72 | + large | |
73 | + @click.native="save1" | |
74 | + style="position:absolute; top:163px; right:5px;" | |
75 | + >Save Edit</v-btn> | |
76 | + </p> | |
77 | + </span> | |
72 | 78 | </v-card-text> |
73 | - </v-card> | |
74 | - </v-dialog> | |
75 | - <v-data-table | |
76 | - :headers="headers" | |
77 | - :items="desserts" | |
78 | - class="elevation-1" | |
79 | - :pagination.sync="pagination" | |
80 | - > | |
81 | - <template slot="items" slot-scope="props"> | |
82 | - <tr v-if="props.index === 0"> | |
83 | - <td id="td"> </td> | |
84 | - <td> | |
85 | - <span style="cursor:pointer" @click="dialog=true"> <v-icon>add</v-icon>Add New Question</span> | |
86 | - </td> | |
87 | - <td id="td"> </td> | |
88 | - <td id="td"> </td> | |
89 | - </tr> | |
90 | - <tr> | |
91 | - <td id="td" class="text-xs-center">{{ props.item.no }}</td> | |
92 | - <td id="td">{{ props.item.ques }}</td> | |
93 | - <td id="td" class="text-xs-center">{{ props.item.res }}</td> | |
94 | - <td class="text-xs-center"> | |
95 | - <span> | |
96 | - <img style="cursor:pointer; height:18px; " class="mr-5" @click="editItem(props.item)" src="/static/icon/edit1.png"/> | |
97 | - <img style="cursor:pointer; height:20px; " class="mr-5" @click="deleteItem(props.item)" src="/static/icon/delete1.png"/> | |
98 | - </span> | |
99 | - </td> | |
100 | - </tr> | |
101 | - </template> | |
102 | - </v-data-table> | |
103 | - </v-card> | |
79 | + </v-card> | |
80 | + </v-dialog> | |
81 | + <v-data-table | |
82 | + :headers="headers" | |
83 | + :items="desserts" | |
84 | + class="elevation-1" | |
85 | + :pagination.sync="pagination" | |
86 | + > | |
87 | + <template slot="items" slot-scope="props"> | |
88 | + <tr v-if="props.index === 0"> | |
89 | + <td id="td"> </td> | |
90 | + <td> | |
91 | + <span style="cursor:pointer" @click="dialog=true"> | |
92 | + <v-icon>add</v-icon>Add New Question | |
93 | + </span> | |
94 | + </td> | |
95 | + <td id="td"> </td> | |
96 | + <td id="td"> </td> | |
97 | + </tr> | |
98 | + <tr> | |
99 | + <td id="td" class="text-xs-center">{{ props.item.no }}</td> | |
100 | + <td id="td">{{ props.item.ques }}</td> | |
101 | + <td id="td" class="text-xs-center">{{ props.item.res }}</td> | |
102 | + <td class="text-xs-center"> | |
103 | + <span> | |
104 | + <img | |
105 | + style="cursor:pointer; height:18px; " | |
106 | + class="mr-5" | |
107 | + @click="editItem(props.item)" | |
108 | + src="/static/icon/edit1.png" | |
109 | + > | |
110 | + <img | |
111 | + style="cursor:pointer; height:20px; " | |
112 | + class="mr-5" | |
113 | + @click="deleteItem(props.item)" | |
114 | + src="/static/icon/delete1.png" | |
115 | + > | |
116 | + </span> | |
117 | + </td> | |
118 | + </tr> | |
119 | + </template> | |
120 | + </v-data-table> | |
121 | + </v-card> | |
104 | 122 | </v-flex> |
105 | - | |
106 | - </v-container> | |
107 | 123 | </template> |
108 | 124 | <script> |
109 | 125 | export default { |
110 | 126 | data: () => ({ |
111 | - question: '', | |
127 | + question: "", | |
112 | 128 | AddQuestioncredentials: {}, |
113 | 129 | dialog: false, |
114 | 130 | dialog1: false, |
115 | 131 | isActive: true, |
116 | 132 | newActive: false, |
117 | 133 | pagination: { |
118 | - rowsPerPage: 10, | |
134 | + rowsPerPage: 10 | |
119 | 135 | }, |
120 | 136 | headers: [ |
121 | 137 | { |
122 | - text: 'No.', | |
123 | - align: 'center', | |
138 | + text: "No.", | |
139 | + align: "center", | |
140 | + sortable: false, | |
141 | + value: "name" | |
142 | + }, | |
143 | + { text: "Posts", value: "posts", sortable: false, align: "center" }, | |
144 | + { | |
145 | + text: "Responses", | |
146 | + value: "responses", | |
124 | 147 | sortable: false, |
125 | - value: 'name' | |
148 | + align: "center" | |
126 | 149 | }, |
127 | - { text: 'Posts', value: 'posts', sortable: false, align: 'center' }, | |
128 | - { text: 'Responses', value: 'responses', sortable: false, align: 'center' }, | |
129 | - { text: '', value: 'carbs', sortable: false, align: 'center' }, | |
150 | + { text: "", value: "carbs", sortable: false, align: "center" } | |
130 | 151 | ], |
131 | 152 | desserts: [], |
132 | 153 | editedIndex: -1, |
133 | 154 | editedItem: { |
134 | - question: '', | |
135 | - | |
155 | + question: "" | |
136 | 156 | }, |
137 | 157 | defaultItem: { |
138 | 158 | no: 0, |
139 | - question: '', | |
140 | - res: 0, | |
141 | - | |
159 | + question: "", | |
160 | + res: 0 | |
142 | 161 | } |
143 | 162 | }), |
144 | 163 | |
145 | 164 | computed: { |
146 | - formTitle () { | |
147 | - return this.editedIndex === -1 ? 'Create New Question' : 'Edit Question'; | |
165 | + formTitle() { | |
166 | + return this.editedIndex === -1 ? "Create New Question" : "Edit Question"; | |
148 | 167 | } |
149 | 168 | }, |
150 | 169 | |
151 | 170 | watch: { |
152 | - dialog (val) { | |
171 | + dialog(val) { | |
153 | 172 | val || this.close(); |
154 | 173 | } |
155 | 174 | }, |
156 | 175 | |
157 | - created () { | |
176 | + created() { | |
158 | 177 | this.initialize(); |
159 | 178 | }, |
160 | 179 | |
161 | 180 | methods: { |
162 | - initialize () { | |
181 | + initialize() { | |
163 | 182 | this.desserts = [ |
164 | 183 | { |
165 | - no: '1', | |
166 | - ques: 'questions diet', | |
167 | - res: 12, | |
168 | - }, | |
184 | + no: "1", | |
185 | + ques: "questions diet", | |
186 | + res: 12 | |
187 | + } | |
169 | 188 | ]; |
170 | - }, | |
189 | + }, | |
171 | 190 | |
172 | - editItem (item) { | |
191 | + editItem(item) { | |
173 | 192 | this.editedIndex = this.desserts.indexOf(item); |
174 | 193 | this.editedItem = Object.assign({}, item); |
175 | 194 | this.dialog1 = true; |
176 | 195 | }, |
177 | 196 | |
178 | - deleteItem (item) { | |
197 | + deleteItem(item) { | |
179 | 198 | const index = this.desserts.indexOf(item); |
180 | - confirm('Are you sure you want to delete this item?') && this.desserts.splice(index, 1); | |
199 | + confirm("Are you sure you want to delete this item?") && | |
200 | + this.desserts.splice(index, 1); | |
181 | 201 | }, |
182 | 202 | |
183 | - close () { | |
203 | + close() { | |
184 | 204 | this.dialog = false; |
185 | 205 | setTimeout(() => { |
186 | 206 | this.editedItem = Object.assign({}, this.defaultItem); |
187 | 207 | this.editedIndex = -1; |
188 | 208 | }, 300); |
189 | 209 | }, |
190 | - close1 () { | |
210 | + close1() { | |
191 | 211 | this.dialog1 = false; |
192 | 212 | setTimeout(() => { |
193 | 213 | this.editedItem = Object.assign({}, this.defaultItem); |
194 | 214 | this.editedIndex = -1; |
195 | 215 | }, 300); |
196 | 216 | }, |
197 | - save () { | |
198 | - console.log('editedItem', this.editedItem); | |
217 | + save() { | |
218 | + console.log("editedItem", this.editedItem); | |
199 | 219 | if (this.editedIndex > -1) { |
200 | 220 | Object.assign(this.desserts[this.editedIndex], this.editedItem); |
201 | 221 | } else { |
... | ... | @@ -203,8 +223,8 @@ export default { |
203 | 223 | } |
204 | 224 | this.close(); |
205 | 225 | }, |
206 | - save1 () { | |
207 | - console.log('editedItem', this.editedItem); | |
226 | + save1() { | |
227 | + console.log("editedItem", this.editedItem); | |
208 | 228 | if (this.editedIndex > -1) { |
209 | 229 | Object.assign(this.desserts[this.editedIndex], this.editedItem); |
210 | 230 | } else { |
... | ... | @@ -212,17 +232,16 @@ export default { |
212 | 232 | } |
213 | 233 | this.close1(); |
214 | 234 | } |
215 | - }, | |
235 | + } | |
216 | 236 | // switchComponent (comp) { |
217 | 237 | // this.$emit('switchComp', comp); |
218 | 238 | // } |
219 | 239 | }; |
220 | 240 | </script> |
221 | 241 | <style> |
222 | -#td{ | |
223 | - border: 1px solid #dddddd; | |
224 | - text-align: left; | |
225 | - padding: 8px; | |
226 | - | |
242 | +#td { | |
243 | + border: 1px solid #dddddd; | |
244 | + text-align: left; | |
245 | + padding: 8px; | |
227 | 246 | } |
228 | 247 | </style> | ... | ... |
src/components/questions/health.vue
1 | 1 | <template> |
2 | -<v-container grid-list-xl> | |
3 | - <v-flex> | |
4 | - <v-card> | |
2 | + <v-flex> | |
3 | + <v-card> | |
5 | 4 | <v-spacer></v-spacer> |
6 | 5 | <v-dialog v-model="dialog" max-width="800px"> |
7 | - | |
8 | 6 | <v-card> |
9 | 7 | <v-card-title> |
10 | 8 | <span class="headline">{{ formTitle }}</span> |
... | ... | @@ -14,188 +12,210 @@ |
14 | 12 | <v-flex> |
15 | 13 | <v-card> |
16 | 14 | <v-card-text> |
17 | - <span> | |
18 | - <p><b>Ana Suggestion:</b> Select Suggestion</p></span> | |
19 | - <h5>Select Category:</h5> | |
20 | - <span> | |
21 | - <v-btn color="grey darken-2" flat>Suggestion</v-btn> | |
22 | - <v-btn color="grey darken-2" flat>Sex</v-btn> | |
23 | - <v-btn color="grey darken-2" flat>Health</v-btn> | |
24 | - <v-btn color="grey darken-2" flat>Skin & Beauty</v-btn> | |
25 | - <v-btn color="grey darken-2" flat>Diet & Ex</v-btn> | |
26 | - </span> | |
15 | + <span> | |
16 | + <p> | |
17 | + <b>Ana Suggestion:</b> Select Suggestion | |
18 | + </p> | |
19 | + </span> | |
20 | + <h5>Select Category:</h5> | |
21 | + <span> | |
22 | + <v-btn color="grey darken-2" flat>Suggestion</v-btn> | |
23 | + <v-btn color="grey darken-2" flat>Sex</v-btn> | |
24 | + <v-btn color="grey darken-2" flat>Health</v-btn> | |
25 | + <v-btn color="grey darken-2" flat>Skin & Beauty</v-btn> | |
26 | + <v-btn color="grey darken-2" flat>Diet & Ex</v-btn> | |
27 | + </span> | |
27 | 28 | </v-card-text> |
28 | - </v-card> | |
29 | + </v-card> | |
29 | 30 | </v-flex> |
30 | 31 | <v-card-text> |
31 | - | |
32 | - <v-container grid-list-md> | |
33 | - <v-layout wrap> | |
34 | - <v-flex xs12 sm6 md12> | |
35 | - <v-textarea | |
36 | - solo | |
37 | - v-model="AddQuestioncredentials.question" | |
38 | - name="input-7-4" | |
39 | - label="Type Question" | |
40 | - ></v-textarea> | |
41 | - </v-flex> | |
32 | + <v-container grid-list-md> | |
33 | + <v-layout wrap> | |
34 | + <v-flex xs12 sm6 md12> | |
35 | + <v-textarea | |
36 | + solo | |
37 | + v-model="AddQuestioncredentials.question" | |
38 | + name="input-7-4" | |
39 | + label="Type Question" | |
40 | + ></v-textarea> | |
41 | + </v-flex> | |
42 | 42 | </v-layout> |
43 | 43 | </v-container> |
44 | 44 | </v-card-text> |
45 | - | |
46 | 45 | <v-card-actions> |
47 | - <v-spacer></v-spacer> | |
48 | - <v-btn dark large @click.native="save">Post Question</v-btn> | |
46 | + <v-spacer></v-spacer> | |
47 | + <v-btn dark large @click.native="save">Post Question</v-btn> | |
49 | 48 | </v-card-actions> |
50 | - </v-card> | |
51 | - </v-dialog> | |
49 | + </v-card> | |
50 | + </v-dialog> | |
52 | 51 | |
53 | - | |
54 | - | |
55 | - <v-dialog v-model="dialog1" max-width="800px"> | |
52 | + <v-dialog v-model="dialog1" max-width="800px"> | |
56 | 53 | <v-card> |
57 | - <v-card-title> | |
58 | - <span class="headline">Edit Question</span> | |
59 | - <v-spacer></v-spacer> | |
60 | - <v-icon @click="close1">close</v-icon> | |
61 | - </v-card-title> | |
54 | + <v-card-title> | |
55 | + <span class="headline">Edit Question</span> | |
56 | + <v-spacer></v-spacer> | |
57 | + <v-icon @click="close1">close</v-icon> | |
58 | + </v-card-title> | |
62 | 59 | |
63 | - <v-card-text> | |
64 | - <v-layout wrap> | |
60 | + <v-card-text> | |
61 | + <v-layout wrap> | |
65 | 62 | <v-flex xs12 sm6 md12> |
66 | 63 | <v-text-field outline v-model="editedItem.ques" label="Question"></v-text-field> |
67 | 64 | </v-flex> |
68 | 65 | </v-layout> |
69 | - <span><p> <b>Ana suggestion:</b> Abnormal Uterine Bleeding <br> | |
70 | - Diagnosis 1,Diagnosis 2,Diagnosis 3 | |
71 | - <v-btn dark large @click.native="save1" style="position:absolute; top:163px; right:5px;">Save Edit</v-btn></p></span> | |
66 | + <span> | |
67 | + <p> | |
68 | + <b>Ana suggestion:</b> Abnormal Uterine Bleeding | |
69 | + <br>Diagnosis 1,Diagnosis 2,Diagnosis 3 | |
70 | + <v-btn | |
71 | + dark | |
72 | + large | |
73 | + @click.native="save1" | |
74 | + style="position:absolute; top:163px; right:5px;" | |
75 | + >Save Edit</v-btn> | |
76 | + </p> | |
77 | + </span> | |
72 | 78 | </v-card-text> |
73 | - </v-card> | |
74 | - </v-dialog> | |
75 | - <v-data-table | |
76 | - :headers="headers" | |
77 | - :items="desserts" | |
78 | - class="elevation-1" | |
79 | - :pagination.sync="pagination" | |
80 | - > | |
81 | - <template slot="items" slot-scope="props"> | |
82 | - <tr v-if="props.index === 0"> | |
83 | - <td id="td"> </td> | |
84 | - <td> | |
85 | - <span style="cursor:pointer" @click="dialog=true"> <v-icon>add</v-icon>Add New Question</span> | |
86 | - </td> | |
87 | - <td id="td"> </td> | |
88 | - <td id="td"> </td> | |
89 | - </tr> | |
90 | - <tr> | |
91 | - <td id="td" class="text-xs-center">{{ props.item.no }}</td> | |
92 | - <td id="td">{{ props.item.ques }}</td> | |
93 | - <td id="td" class="text-xs-center">{{ props.item.res }}</td> | |
94 | - <td class="text-xs-center"> | |
95 | - <span> | |
96 | - <img style="cursor:pointer; height:18px; " class="mr-5" @click="editItem(props.item)" src="/static/icon/edit1.png"/> | |
97 | - <img style="cursor:pointer; height:20px; " class="mr-5" @click="deleteItem(props.item)" src="/static/icon/delete1.png"/> | |
98 | - </span> | |
99 | - </td> | |
100 | - </tr> | |
101 | - </template> | |
102 | - </v-data-table> | |
103 | - </v-card> | |
79 | + </v-card> | |
80 | + </v-dialog> | |
81 | + <v-data-table | |
82 | + :headers="headers" | |
83 | + :items="desserts" | |
84 | + class="elevation-1" | |
85 | + :pagination.sync="pagination" | |
86 | + > | |
87 | + <template slot="items" slot-scope="props"> | |
88 | + <tr v-if="props.index === 0"> | |
89 | + <td id="td"> </td> | |
90 | + <td> | |
91 | + <span style="cursor:pointer" @click="dialog=true"> | |
92 | + <v-icon>add</v-icon>Add New Question | |
93 | + </span> | |
94 | + </td> | |
95 | + <td id="td"> </td> | |
96 | + <td id="td"> </td> | |
97 | + </tr> | |
98 | + <tr> | |
99 | + <td id="td" class="text-xs-center">{{ props.item.no }}</td> | |
100 | + <td id="td">{{ props.item.ques }}</td> | |
101 | + <td id="td" class="text-xs-center">{{ props.item.res }}</td> | |
102 | + <td class="text-xs-center"> | |
103 | + <span> | |
104 | + <img | |
105 | + style="cursor:pointer; height:18px; " | |
106 | + class="mr-5" | |
107 | + @click="editItem(props.item)" | |
108 | + src="/static/icon/edit1.png" | |
109 | + > | |
110 | + <img | |
111 | + style="cursor:pointer; height:20px; " | |
112 | + class="mr-5" | |
113 | + @click="deleteItem(props.item)" | |
114 | + src="/static/icon/delete1.png" | |
115 | + > | |
116 | + </span> | |
117 | + </td> | |
118 | + </tr> | |
119 | + </template> | |
120 | + </v-data-table> | |
121 | + </v-card> | |
104 | 122 | </v-flex> |
105 | - | |
106 | - </v-container> | |
107 | 123 | </template> |
108 | 124 | <script> |
109 | 125 | export default { |
110 | 126 | data: () => ({ |
111 | - question: '', | |
127 | + question: "", | |
112 | 128 | AddQuestioncredentials: {}, |
113 | 129 | dialog: false, |
114 | 130 | dialog1: false, |
115 | 131 | isActive: true, |
116 | 132 | newActive: false, |
117 | 133 | pagination: { |
118 | - rowsPerPage: 10, | |
134 | + rowsPerPage: 10 | |
119 | 135 | }, |
120 | 136 | headers: [ |
121 | 137 | { |
122 | - text: 'No.', | |
123 | - align: 'center', | |
138 | + text: "No.", | |
139 | + align: "center", | |
140 | + sortable: false, | |
141 | + value: "name" | |
142 | + }, | |
143 | + { text: "Posts", value: "posts", sortable: false, align: "center" }, | |
144 | + { | |
145 | + text: "Responses", | |
146 | + value: "responses", | |
124 | 147 | sortable: false, |
125 | - value: 'name' | |
148 | + align: "center" | |
126 | 149 | }, |
127 | - { text: 'Posts', value: 'posts', sortable: false, align: 'center' }, | |
128 | - { text: 'Responses', value: 'responses', sortable: false, align: 'center' }, | |
129 | - { text: '', value: 'carbs', sortable: false, align: 'center' }, | |
150 | + { text: "", value: "carbs", sortable: false, align: "center" } | |
130 | 151 | ], |
131 | 152 | desserts: [], |
132 | 153 | editedIndex: -1, |
133 | 154 | editedItem: { |
134 | - question: '', | |
135 | - | |
155 | + question: "" | |
136 | 156 | }, |
137 | 157 | defaultItem: { |
138 | 158 | no: 0, |
139 | - question: '', | |
140 | - res: 0, | |
141 | - | |
159 | + question: "", | |
160 | + res: 0 | |
142 | 161 | } |
143 | 162 | }), |
144 | 163 | |
145 | 164 | computed: { |
146 | - formTitle () { | |
147 | - return this.editedIndex === -1 ? 'Create New Question' : 'Edit Question'; | |
165 | + formTitle() { | |
166 | + return this.editedIndex === -1 ? "Create New Question" : "Edit Question"; | |
148 | 167 | } |
149 | 168 | }, |
150 | 169 | |
151 | 170 | watch: { |
152 | - dialog (val) { | |
171 | + dialog(val) { | |
153 | 172 | val || this.close(); |
154 | 173 | } |
155 | 174 | }, |
156 | 175 | |
157 | - created () { | |
176 | + created() { | |
158 | 177 | this.initialize(); |
159 | 178 | }, |
160 | 179 | |
161 | 180 | methods: { |
162 | - initialize () { | |
181 | + initialize() { | |
163 | 182 | this.desserts = [ |
164 | 183 | { |
165 | - no: '1', | |
166 | - ques: 'questions health', | |
167 | - res: 11, | |
168 | - }, | |
184 | + no: "1", | |
185 | + ques: "questions health", | |
186 | + res: 11 | |
187 | + } | |
169 | 188 | ]; |
170 | - }, | |
189 | + }, | |
171 | 190 | |
172 | - editItem (item) { | |
191 | + editItem(item) { | |
173 | 192 | this.editedIndex = this.desserts.indexOf(item); |
174 | 193 | this.editedItem = Object.assign({}, item); |
175 | 194 | this.dialog1 = true; |
176 | 195 | }, |
177 | 196 | |
178 | - deleteItem (item) { | |
197 | + deleteItem(item) { | |
179 | 198 | const index = this.desserts.indexOf(item); |
180 | - confirm('Are you sure you want to delete this item?') && this.desserts.splice(index, 1); | |
199 | + confirm("Are you sure you want to delete this item?") && | |
200 | + this.desserts.splice(index, 1); | |
181 | 201 | }, |
182 | 202 | |
183 | - close () { | |
203 | + close() { | |
184 | 204 | this.dialog = false; |
185 | 205 | setTimeout(() => { |
186 | 206 | this.editedItem = Object.assign({}, this.defaultItem); |
187 | 207 | this.editedIndex = -1; |
188 | 208 | }, 300); |
189 | 209 | }, |
190 | - close1 () { | |
210 | + close1() { | |
191 | 211 | this.dialog1 = false; |
192 | 212 | setTimeout(() => { |
193 | 213 | this.editedItem = Object.assign({}, this.defaultItem); |
194 | 214 | this.editedIndex = -1; |
195 | 215 | }, 300); |
196 | 216 | }, |
197 | - save () { | |
198 | - console.log('editedItem', this.editedItem); | |
217 | + save() { | |
218 | + console.log("editedItem", this.editedItem); | |
199 | 219 | if (this.editedIndex > -1) { |
200 | 220 | Object.assign(this.desserts[this.editedIndex], this.editedItem); |
201 | 221 | } else { |
... | ... | @@ -203,8 +223,8 @@ export default { |
203 | 223 | } |
204 | 224 | this.close(); |
205 | 225 | }, |
206 | - save1 () { | |
207 | - console.log('editedItem', this.editedItem); | |
226 | + save1() { | |
227 | + console.log("editedItem", this.editedItem); | |
208 | 228 | if (this.editedIndex > -1) { |
209 | 229 | Object.assign(this.desserts[this.editedIndex], this.editedItem); |
210 | 230 | } else { |
... | ... | @@ -212,17 +232,16 @@ export default { |
212 | 232 | } |
213 | 233 | this.close1(); |
214 | 234 | } |
215 | - }, | |
235 | + } | |
216 | 236 | // switchComponent (comp) { |
217 | 237 | // this.$emit('switchComp', comp); |
218 | 238 | // } |
219 | 239 | }; |
220 | 240 | </script> |
221 | 241 | <style> |
222 | -#td{ | |
223 | - border: 1px solid #dddddd; | |
224 | - text-align: left; | |
225 | - padding: 8px; | |
226 | - | |
242 | +#td { | |
243 | + border: 1px solid #dddddd; | |
244 | + text-align: left; | |
245 | + padding: 8px; | |
227 | 246 | } |
228 | 247 | </style> | ... | ... |
src/components/questions/sex.vue
1 | 1 | <template> |
2 | -<v-container grid-list-xl> | |
3 | - <v-flex> | |
4 | - <v-card> | |
2 | + <v-flex> | |
3 | + <v-card> | |
5 | 4 | <v-spacer></v-spacer> |
6 | 5 | <v-dialog v-model="dialog" max-width="800px"> |
7 | - | |
8 | 6 | <v-card> |
9 | 7 | <v-card-title> |
10 | 8 | <span class="headline">{{ formTitle }}</span> |
... | ... | @@ -14,188 +12,211 @@ |
14 | 12 | <v-flex> |
15 | 13 | <v-card> |
16 | 14 | <v-card-text> |
17 | - <span> | |
18 | - <p><b>Ana Suggestion:</b> Select Suggestion</p></span> | |
19 | - <h5>Select Category:</h5> | |
20 | - <span> | |
21 | - <v-btn color="grey darken-2" flat>Suggestion</v-btn> | |
22 | - <v-btn color="grey darken-2" flat>Sex</v-btn> | |
23 | - <v-btn color="grey darken-2" flat>Health</v-btn> | |
24 | - <v-btn color="grey darken-2" flat>Skin & Beauty</v-btn> | |
25 | - <v-btn color="grey darken-2" flat>Diet & Ex</v-btn> | |
26 | - </span> | |
15 | + <span> | |
16 | + <p> | |
17 | + <b>Ana Suggestion:</b> Select Suggestion | |
18 | + </p> | |
19 | + </span> | |
20 | + <h5>Select Category:</h5> | |
21 | + <span> | |
22 | + <v-btn color="grey darken-2" flat>Suggestion</v-btn> | |
23 | + <v-btn color="grey darken-2" flat>Sex</v-btn> | |
24 | + <v-btn color="grey darken-2" flat>Health</v-btn> | |
25 | + <v-btn color="grey darken-2" flat>Skin & Beauty</v-btn> | |
26 | + <v-btn color="grey darken-2" flat>Diet & Ex</v-btn> | |
27 | + </span> | |
27 | 28 | </v-card-text> |
28 | - </v-card> | |
29 | + </v-card> | |
29 | 30 | </v-flex> |
30 | 31 | <v-card-text> |
31 | - | |
32 | - <v-container grid-list-md> | |
33 | - <v-layout wrap> | |
34 | - <v-flex xs12 sm6 md12> | |
35 | - <v-textarea | |
36 | - solo | |
37 | - v-model="AddQuestioncredentials.question" | |
38 | - name="input-7-4" | |
39 | - label="Type Question" | |
40 | - ></v-textarea> | |
41 | - </v-flex> | |
32 | + <v-container grid-list-md> | |
33 | + <v-layout wrap> | |
34 | + <v-flex xs12 sm6 md12> | |
35 | + <v-textarea | |
36 | + solo | |
37 | + v-model="AddQuestioncredentials.question" | |
38 | + name="input-7-4" | |
39 | + label="Type Question" | |
40 | + ></v-textarea> | |
41 | + </v-flex> | |
42 | 42 | </v-layout> |
43 | 43 | </v-container> |
44 | 44 | </v-card-text> |
45 | 45 | |
46 | 46 | <v-card-actions> |
47 | - <v-spacer></v-spacer> | |
48 | - <v-btn dark large @click.native="save">Post Question</v-btn> | |
47 | + <v-spacer></v-spacer> | |
48 | + <v-btn dark large @click.native="save">Post Question</v-btn> | |
49 | 49 | </v-card-actions> |
50 | - </v-card> | |
51 | - </v-dialog> | |
50 | + </v-card> | |
51 | + </v-dialog> | |
52 | 52 | |
53 | - | |
54 | - | |
55 | - <v-dialog v-model="dialog1" max-width="800px"> | |
53 | + <v-dialog v-model="dialog1" max-width="800px"> | |
56 | 54 | <v-card> |
57 | - <v-card-title> | |
58 | - <span class="headline">Edit Question</span> | |
59 | - <v-spacer></v-spacer> | |
60 | - <v-icon @click="close1">close</v-icon> | |
61 | - </v-card-title> | |
55 | + <v-card-title> | |
56 | + <span class="headline">Edit Question</span> | |
57 | + <v-spacer></v-spacer> | |
58 | + <v-icon @click="close1">close</v-icon> | |
59 | + </v-card-title> | |
62 | 60 | |
63 | - <v-card-text> | |
64 | - <v-layout wrap> | |
61 | + <v-card-text> | |
62 | + <v-layout wrap> | |
65 | 63 | <v-flex xs12 sm6 md12> |
66 | 64 | <v-text-field outline v-model="editedItem.ques" label="Question"></v-text-field> |
67 | 65 | </v-flex> |
68 | 66 | </v-layout> |
69 | - <span><p> <b>Ana suggestion:</b> Abnormal Uterine Bleeding <br> | |
70 | - Diagnosis 1,Diagnosis 2,Diagnosis 3 | |
71 | - <v-btn dark large @click.native="save1" style="position:absolute; top:163px; right:5px;">Save Edit</v-btn></p></span> | |
67 | + <span> | |
68 | + <p> | |
69 | + <b>Ana suggestion:</b> Abnormal Uterine Bleeding | |
70 | + <br>Diagnosis 1,Diagnosis 2,Diagnosis 3 | |
71 | + <v-btn | |
72 | + dark | |
73 | + large | |
74 | + @click.native="save1" | |
75 | + style="position:absolute; top:163px; right:5px;" | |
76 | + >Save Edit</v-btn> | |
77 | + </p> | |
78 | + </span> | |
72 | 79 | </v-card-text> |
73 | - </v-card> | |
74 | - </v-dialog> | |
75 | - <v-data-table | |
76 | - :headers="headers" | |
77 | - :items="desserts" | |
78 | - class="elevation-1" | |
79 | - :pagination.sync="pagination" | |
80 | - > | |
81 | - <template slot="items" slot-scope="props"> | |
82 | - <tr v-if="props.index === 0"> | |
83 | - <td id="td"> </td> | |
84 | - <td> | |
85 | - <span style="cursor:pointer" @click="dialog=true"> <v-icon>add</v-icon>Add New Question</span> | |
86 | - </td> | |
87 | - <td id="td"> </td> | |
88 | - <td id="td"> </td> | |
89 | - </tr> | |
90 | - <tr> | |
91 | - <td id="td" class="text-xs-center">{{ props.item.no }}</td> | |
92 | - <td id="td">{{ props.item.ques }}</td> | |
93 | - <td id="td" class="text-xs-center">{{ props.item.res }}</td> | |
94 | - <td class="text-xs-center"> | |
95 | - <span> | |
96 | - <img style="cursor:pointer; height:18px; " class="mr-5" @click="editItem(props.item)" src="/static/icon/edit1.png"/> | |
97 | - <img style="cursor:pointer; height:20px; " class="mr-5" @click="deleteItem(props.item)" src="/static/icon/delete1.png"/> | |
98 | - </span> | |
99 | - </td> | |
100 | - </tr> | |
101 | - </template> | |
102 | - </v-data-table> | |
103 | - </v-card> | |
80 | + </v-card> | |
81 | + </v-dialog> | |
82 | + <v-data-table | |
83 | + :headers="headers" | |
84 | + :items="desserts" | |
85 | + class="elevation-1" | |
86 | + :pagination.sync="pagination" | |
87 | + > | |
88 | + <template slot="items" slot-scope="props"> | |
89 | + <tr v-if="props.index === 0"> | |
90 | + <td id="td"> </td> | |
91 | + <td> | |
92 | + <span style="cursor:pointer" @click="dialog=true"> | |
93 | + <v-icon>add</v-icon>Add New Question | |
94 | + </span> | |
95 | + </td> | |
96 | + <td id="td"> </td> | |
97 | + <td id="td"> </td> | |
98 | + </tr> | |
99 | + <tr> | |
100 | + <td id="td" class="text-xs-center">{{ props.item.no }}</td> | |
101 | + <td id="td">{{ props.item.ques }}</td> | |
102 | + <td id="td" class="text-xs-center">{{ props.item.res }}</td> | |
103 | + <td class="text-xs-center"> | |
104 | + <span> | |
105 | + <img | |
106 | + style="cursor:pointer; height:18px; " | |
107 | + class="mr-5" | |
108 | + @click="editItem(props.item)" | |
109 | + src="/static/icon/edit1.png" | |
110 | + > | |
111 | + <img | |
112 | + style="cursor:pointer; height:20px; " | |
113 | + class="mr-5" | |
114 | + @click="deleteItem(props.item)" | |
115 | + src="/static/icon/delete1.png" | |
116 | + > | |
117 | + </span> | |
118 | + </td> | |
119 | + </tr> | |
120 | + </template> | |
121 | + </v-data-table> | |
122 | + </v-card> | |
104 | 123 | </v-flex> |
105 | - | |
106 | - </v-container> | |
107 | 124 | </template> |
108 | 125 | <script> |
109 | 126 | export default { |
110 | 127 | data: () => ({ |
111 | - question: '', | |
128 | + question: "", | |
112 | 129 | AddQuestioncredentials: {}, |
113 | 130 | dialog: false, |
114 | 131 | dialog1: false, |
115 | 132 | isActive: true, |
116 | 133 | newActive: false, |
117 | 134 | pagination: { |
118 | - rowsPerPage: 10, | |
135 | + rowsPerPage: 10 | |
119 | 136 | }, |
120 | 137 | headers: [ |
121 | 138 | { |
122 | - text: 'No.', | |
123 | - align: 'center', | |
139 | + text: "No.", | |
140 | + align: "center", | |
141 | + sortable: false, | |
142 | + value: "name" | |
143 | + }, | |
144 | + { text: "Posts", value: "posts", sortable: false, align: "center" }, | |
145 | + { | |
146 | + text: "Responses", | |
147 | + value: "responses", | |
124 | 148 | sortable: false, |
125 | - value: 'name' | |
149 | + align: "center" | |
126 | 150 | }, |
127 | - { text: 'Posts', value: 'posts', sortable: false, align: 'center' }, | |
128 | - { text: 'Responses', value: 'responses', sortable: false, align: 'center' }, | |
129 | - { text: '', value: 'carbs', sortable: false, align: 'center' }, | |
151 | + { text: "", value: "carbs", sortable: false, align: "center" } | |
130 | 152 | ], |
131 | 153 | desserts: [], |
132 | 154 | editedIndex: -1, |
133 | 155 | editedItem: { |
134 | - question: '', | |
135 | - | |
156 | + question: "" | |
136 | 157 | }, |
137 | 158 | defaultItem: { |
138 | 159 | no: 0, |
139 | - question: '', | |
140 | - res: 0, | |
141 | - | |
160 | + question: "", | |
161 | + res: 0 | |
142 | 162 | } |
143 | 163 | }), |
144 | 164 | |
145 | 165 | computed: { |
146 | - formTitle () { | |
147 | - return this.editedIndex === -1 ? 'Create New Question' : 'Edit Question'; | |
166 | + formTitle() { | |
167 | + return this.editedIndex === -1 ? "Create New Question" : "Edit Question"; | |
148 | 168 | } |
149 | 169 | }, |
150 | 170 | |
151 | 171 | watch: { |
152 | - dialog (val) { | |
172 | + dialog(val) { | |
153 | 173 | val || this.close(); |
154 | 174 | } |
155 | 175 | }, |
156 | 176 | |
157 | - created () { | |
177 | + created() { | |
158 | 178 | this.initialize(); |
159 | 179 | }, |
160 | 180 | |
161 | 181 | methods: { |
162 | - initialize () { | |
182 | + initialize() { | |
163 | 183 | this.desserts = [ |
164 | 184 | { |
165 | - no: '1', | |
166 | - ques: 'questions sex', | |
167 | - res: 8, | |
168 | - }, | |
185 | + no: "1", | |
186 | + ques: "questions sex", | |
187 | + res: 8 | |
188 | + } | |
169 | 189 | ]; |
170 | - }, | |
190 | + }, | |
171 | 191 | |
172 | - editItem (item) { | |
192 | + editItem(item) { | |
173 | 193 | this.editedIndex = this.desserts.indexOf(item); |
174 | 194 | this.editedItem = Object.assign({}, item); |
175 | 195 | this.dialog1 = true; |
176 | 196 | }, |
177 | 197 | |
178 | - deleteItem (item) { | |
198 | + deleteItem(item) { | |
179 | 199 | const index = this.desserts.indexOf(item); |
180 | - confirm('Are you sure you want to delete this item?') && this.desserts.splice(index, 1); | |
200 | + confirm("Are you sure you want to delete this item?") && | |
201 | + this.desserts.splice(index, 1); | |
181 | 202 | }, |
182 | 203 | |
183 | - close () { | |
204 | + close() { | |
184 | 205 | this.dialog = false; |
185 | 206 | setTimeout(() => { |
186 | 207 | this.editedItem = Object.assign({}, this.defaultItem); |
187 | 208 | this.editedIndex = -1; |
188 | 209 | }, 300); |
189 | 210 | }, |
190 | - close1 () { | |
211 | + close1() { | |
191 | 212 | this.dialog1 = false; |
192 | 213 | setTimeout(() => { |
193 | 214 | this.editedItem = Object.assign({}, this.defaultItem); |
194 | 215 | this.editedIndex = -1; |
195 | 216 | }, 300); |
196 | 217 | }, |
197 | - save () { | |
198 | - console.log('editedItem', this.editedItem); | |
218 | + save() { | |
219 | + console.log("editedItem", this.editedItem); | |
199 | 220 | if (this.editedIndex > -1) { |
200 | 221 | Object.assign(this.desserts[this.editedIndex], this.editedItem); |
201 | 222 | } else { |
... | ... | @@ -203,8 +224,8 @@ export default { |
203 | 224 | } |
204 | 225 | this.close(); |
205 | 226 | }, |
206 | - save1 () { | |
207 | - console.log('editedItem', this.editedItem); | |
227 | + save1() { | |
228 | + console.log("editedItem", this.editedItem); | |
208 | 229 | if (this.editedIndex > -1) { |
209 | 230 | Object.assign(this.desserts[this.editedIndex], this.editedItem); |
210 | 231 | } else { |
... | ... | @@ -212,17 +233,16 @@ export default { |
212 | 233 | } |
213 | 234 | this.close1(); |
214 | 235 | } |
215 | - }, | |
236 | + } | |
216 | 237 | // switchComponent (comp) { |
217 | 238 | // this.$emit('switchComp', comp); |
218 | 239 | // } |
219 | 240 | }; |
220 | 241 | </script> |
221 | 242 | <style> |
222 | -#td{ | |
223 | - border: 1px solid #dddddd; | |
224 | - text-align: left; | |
225 | - padding: 8px; | |
226 | - | |
243 | +#td { | |
244 | + border: 1px solid #dddddd; | |
245 | + text-align: left; | |
246 | + padding: 8px; | |
227 | 247 | } |
228 | 248 | </style> | ... | ... |
src/components/questions/skin.vue
src/components/questions/suggestion.vue
1 | 1 | <template> |
2 | -<v-container grid-list-xl> | |
3 | - <v-flex> | |
4 | - <v-card> | |
2 | + <v-flex> | |
3 | + <v-card> | |
5 | 4 | <v-spacer></v-spacer> |
6 | 5 | <v-dialog v-model="dialog" max-width="800px"> |
7 | - | |
8 | 6 | <v-card> |
9 | 7 | <v-card-title> |
10 | 8 | <span class="headline">{{ formTitle }}</span> |
... | ... | @@ -14,189 +12,242 @@ |
14 | 12 | <v-flex> |
15 | 13 | <v-card> |
16 | 14 | <v-card-text> |
17 | - <span> | |
18 | - <p><b>Ana Suggestion:</b> Select Suggestion</p></span> | |
19 | - <h5>Select Category:</h5> | |
20 | - <span> | |
21 | - <v-btn color="grey darken-2" flat>Suggestion</v-btn> | |
22 | - <v-btn color="grey darken-2" flat>Sex</v-btn> | |
23 | - <v-btn color="grey darken-2" flat>Health</v-btn> | |
24 | - <v-btn color="grey darken-2" flat>Skin & Beauty</v-btn> | |
25 | - <v-btn color="grey darken-2" flat>Diet & Ex</v-btn> | |
26 | - </span> | |
15 | + <span> | |
16 | + <p> | |
17 | + <b>Ana Suggestion:</b> Select Suggestion | |
18 | + </p> | |
19 | + </span> | |
20 | + <h5>Select Category:</h5> | |
21 | + <span> | |
22 | + <v-btn color="grey darken-2" flat>Suggestion</v-btn> | |
23 | + <v-btn color="grey darken-2" flat>Sex</v-btn> | |
24 | + <v-btn color="grey darken-2" flat>Health</v-btn> | |
25 | + <v-btn color="grey darken-2" flat>Skin & Beauty</v-btn> | |
26 | + <v-btn color="grey darken-2" flat>Diet & Ex</v-btn> | |
27 | + </span> | |
27 | 28 | </v-card-text> |
28 | - </v-card> | |
29 | + </v-card> | |
29 | 30 | </v-flex> |
30 | 31 | <v-card-text> |
31 | - | |
32 | - <v-container grid-list-md> | |
33 | - <v-layout wrap> | |
34 | - <v-flex xs12 sm6 md12> | |
35 | - <v-textarea | |
36 | - solo | |
37 | - v-model="AddQuestioncredentials.question" | |
38 | - name="input-7-4" | |
39 | - label="Type Question" | |
40 | - ></v-textarea> | |
41 | - </v-flex> | |
32 | + <v-container grid-list-md> | |
33 | + <v-layout wrap> | |
34 | + <v-flex xs12 sm6 md12> | |
35 | + <v-textarea | |
36 | + solo | |
37 | + v-model="AddQuestioncredentials.question" | |
38 | + name="input-7-4" | |
39 | + label="Type Question" | |
40 | + ></v-textarea> | |
41 | + </v-flex> | |
42 | 42 | </v-layout> |
43 | 43 | </v-container> |
44 | 44 | </v-card-text> |
45 | 45 | |
46 | 46 | <v-card-actions> |
47 | - <v-spacer></v-spacer> | |
48 | - <v-btn dark large @click.native="save">Post Question</v-btn> | |
47 | + <v-spacer></v-spacer> | |
48 | + <v-btn dark large @click.native="save">Post Question</v-btn> | |
49 | 49 | </v-card-actions> |
50 | - </v-card> | |
51 | - </v-dialog> | |
52 | - | |
53 | - | |
54 | - | |
55 | - <v-dialog v-model="dialog1" max-width="800px"> | |
50 | + </v-card> | |
51 | + </v-dialog> | |
52 | + <v-dialog v-model="dialog1" max-width="800px"> | |
56 | 53 | <v-card> |
57 | - <v-card-title> | |
58 | - <span class="headline">Edit Question</span> | |
59 | - <v-spacer></v-spacer> | |
60 | - <v-icon @click="close1">close</v-icon> | |
61 | - </v-card-title> | |
54 | + <v-card-title> | |
55 | + <span class="headline">Edit Question</span> | |
56 | + <v-spacer></v-spacer> | |
57 | + <v-icon @click="close1">close</v-icon> | |
58 | + </v-card-title> | |
62 | 59 | |
63 | - <v-card-text> | |
64 | - <v-layout wrap> | |
60 | + <v-card-text> | |
61 | + <v-layout wrap> | |
65 | 62 | <v-flex xs12 sm6 md12> |
66 | 63 | <v-text-field outline v-model="editedItem.ques" label="Question"></v-text-field> |
67 | 64 | </v-flex> |
68 | 65 | </v-layout> |
69 | - <span><p> <b>Ana suggestion:</b> Abnormal Uterine Bleeding <br> | |
70 | - Diagnosis 1,Diagnosis 2,Diagnosis 3 | |
71 | - <v-btn dark large @click.native="save1" style="position:absolute; top:163px; right:5px;">Save Edit</v-btn></p></span> | |
66 | + <span> | |
67 | + <p> | |
68 | + <b>Ana suggestion:</b> Abnormal Uterine Bleeding | |
69 | + <br>Diagnosis 1,Diagnosis 2,Diagnosis 3 | |
70 | + <v-btn | |
71 | + dark | |
72 | + large | |
73 | + @click.native="save1" | |
74 | + style="position:absolute; top:163px; right:5px;" | |
75 | + >Save Edit</v-btn> | |
76 | + </p> | |
77 | + </span> | |
72 | 78 | </v-card-text> |
73 | - </v-card> | |
74 | - </v-dialog> | |
75 | - <v-card> | |
76 | - <v-data-table | |
77 | - :headers="headers" | |
78 | - :items="desserts" | |
79 | - class="elevation-1" | |
80 | - :pagination.sync="pagination" | |
81 | - > | |
82 | - <template slot="items" slot-scope="props"> | |
83 | - <tr v-if="props.index === 0"> | |
84 | - <td id="td"> </td> | |
85 | - <td> | |
86 | - <span style="cursor:pointer" @click="dialog=true"> <v-icon>add</v-icon>Add New Question</span> | |
87 | - </td> | |
88 | - <td id="td"> </td> | |
89 | - <td id="td"> </td> | |
90 | - </tr> | |
91 | - <tr> | |
92 | - <td id="td" class="text-xs-center">{{ props.item.no }}</td> | |
93 | - <td id="td">{{ props.item.ques }}</td> | |
94 | - <td id="td" class="text-xs-center">{{ props.item.res }}</td> | |
95 | - <td class="text-xs-center"> | |
96 | - <span> | |
97 | - <img style="cursor:pointer; height:18px; " class="mr-5" @click="editItem(props.item)" src="/static/icon/edit1.png"/> | |
98 | - <img style="cursor:pointer; height:20px; " class="mr-5" @click="deleteItem(props.item)" src="/static/icon/delete1.png"/> | |
99 | - </span> | |
100 | - </td> | |
101 | - </tr> | |
102 | - </template> | |
103 | - </v-data-table></v-card> | |
104 | - </v-card> | |
79 | + </v-card> | |
80 | + </v-dialog> | |
81 | + <v-card> | |
82 | + <v-data-table | |
83 | + :headers="headers" | |
84 | + :items="desserts" | |
85 | + class="elevation-1" | |
86 | + :pagination.sync="pagination" | |
87 | + > | |
88 | + <template slot="items" slot-scope="props"> | |
89 | + <tr v-if="props.index === 0"> | |
90 | + <td id="td"> </td> | |
91 | + <td> | |
92 | + <span style="cursor:pointer" @click="dialog=true"> | |
93 | + <v-icon>add</v-icon>Add New Question | |
94 | + </span> | |
95 | + </td> | |
96 | + <td id="td"> </td> | |
97 | + <td id="td"> </td> | |
98 | + </tr> | |
99 | + <tr> | |
100 | + <td id="td" class="text-xs-center">{{ props.item.no }}</td> | |
101 | + <td id="td">{{ props.item.ques }}</td> | |
102 | + <td id="td" class="text-xs-center">{{ props.item.res }}</td> | |
103 | + <td class="text-xs-center"> | |
104 | + <span> | |
105 | + <img | |
106 | + style="cursor:pointer; height:18px; " | |
107 | + class="mr-5" | |
108 | + @click="editItem(props.item)" | |
109 | + src="/static/icon/edit1.png" | |
110 | + > | |
111 | + <img | |
112 | + style="cursor:pointer; height:20px; " | |
113 | + class="mr-5" | |
114 | + @click="deleteItem(props.item)" | |
115 | + src="/static/icon/delete1.png" | |
116 | + > | |
117 | + </span> | |
118 | + </td> | |
119 | + </tr> | |
120 | + </template> | |
121 | + </v-data-table> | |
122 | + </v-card> | |
123 | + </v-card> | |
105 | 124 | </v-flex> |
106 | - | |
107 | - </v-container> | |
108 | 125 | </template> |
109 | 126 | <script> |
110 | 127 | export default { |
111 | 128 | data: () => ({ |
112 | - question: '', | |
129 | + question: "", | |
113 | 130 | AddQuestioncredentials: {}, |
114 | 131 | dialog: false, |
115 | 132 | dialog1: false, |
116 | 133 | isActive: true, |
117 | 134 | newActive: false, |
118 | 135 | pagination: { |
119 | - rowsPerPage: 10, | |
136 | + rowsPerPage: 10 | |
120 | 137 | }, |
121 | 138 | headers: [ |
122 | 139 | { |
123 | - text: 'No.', | |
124 | - align: 'center', | |
140 | + text: "No.", | |
141 | + align: "center", | |
142 | + sortable: false, | |
143 | + value: "name" | |
144 | + }, | |
145 | + { text: "Posts", value: "posts", sortable: false, align: "center" }, | |
146 | + { | |
147 | + text: "Responses", | |
148 | + value: "responses", | |
125 | 149 | sortable: false, |
126 | - value: 'name' | |
150 | + align: "center" | |
127 | 151 | }, |
128 | - { text: 'Posts', value: 'posts', sortable: false, align: 'center' }, | |
129 | - { text: 'Responses', value: 'responses', sortable: false, align: 'center' }, | |
130 | - { text: '', value: 'carbs', sortable: false, align: 'center' }, | |
152 | + { text: "", value: "carbs", sortable: false, align: "center" } | |
131 | 153 | ], |
132 | 154 | desserts: [], |
133 | 155 | editedIndex: -1, |
134 | 156 | editedItem: { |
135 | - question: '', | |
136 | - | |
157 | + question: "" | |
137 | 158 | }, |
138 | 159 | defaultItem: { |
139 | 160 | no: 0, |
140 | - question: '', | |
141 | - res: 0, | |
142 | - | |
161 | + question: "", | |
162 | + res: 0 | |
143 | 163 | } |
144 | 164 | }), |
145 | 165 | |
146 | 166 | computed: { |
147 | - formTitle () { | |
148 | - return this.editedIndex === -1 ? 'Create New Question' : 'Edit Question'; | |
167 | + formTitle() { | |
168 | + return this.editedIndex === -1 ? "Create New Question" : "Edit Question"; | |
149 | 169 | } |
150 | 170 | }, |
151 | 171 | |
152 | 172 | watch: { |
153 | - dialog (val) { | |
173 | + dialog(val) { | |
154 | 174 | val || this.close(); |
155 | 175 | } |
156 | 176 | }, |
157 | 177 | |
158 | - created () { | |
178 | + created() { | |
159 | 179 | this.initialize(); |
160 | 180 | }, |
161 | 181 | |
162 | 182 | methods: { |
163 | - initialize () { | |
183 | + initialize() { | |
164 | 184 | this.desserts = [ |
165 | 185 | { |
166 | - no: '1', | |
167 | - ques: 'questions suggestion', | |
168 | - res: 21, | |
186 | + no: "1", | |
187 | + ques: "questions suggestion", | |
188 | + res: 21 | |
189 | + }, | |
190 | + { | |
191 | + no: "1", | |
192 | + ques: "questions", | |
193 | + res: 21 | |
194 | + }, | |
195 | + { | |
196 | + no: "1", | |
197 | + ques: " suggestion", | |
198 | + res: 21 | |
199 | + }, | |
200 | + { | |
201 | + no: "1", | |
202 | + ques: "questions", | |
203 | + res: 21 | |
169 | 204 | }, |
205 | + { | |
206 | + no: "1", | |
207 | + ques: "questions suggestion", | |
208 | + res: 21 | |
209 | + }, | |
210 | + { | |
211 | + no: "1", | |
212 | + ques: "suggestion", | |
213 | + res: 21 | |
214 | + }, | |
215 | + { | |
216 | + no: "1", | |
217 | + ques: "questions suggestion", | |
218 | + res: 21 | |
219 | + } | |
170 | 220 | ]; |
171 | - }, | |
221 | + }, | |
172 | 222 | |
173 | - editItem (item) { | |
223 | + editItem(item) { | |
174 | 224 | this.editedIndex = this.desserts.indexOf(item); |
175 | 225 | this.editedItem = Object.assign({}, item); |
176 | 226 | this.dialog1 = true; |
177 | 227 | }, |
178 | 228 | |
179 | - deleteItem (item) { | |
229 | + deleteItem(item) { | |
180 | 230 | const index = this.desserts.indexOf(item); |
181 | - confirm('Are you sure you want to delete this item?') && this.desserts.splice(index, 1); | |
231 | + confirm("Are you sure you want to delete this item?") && | |
232 | + this.desserts.splice(index, 1); | |
182 | 233 | }, |
183 | 234 | |
184 | - close () { | |
235 | + close() { | |
185 | 236 | this.dialog = false; |
186 | 237 | setTimeout(() => { |
187 | 238 | this.editedItem = Object.assign({}, this.defaultItem); |
188 | 239 | this.editedIndex = -1; |
189 | 240 | }, 300); |
190 | 241 | }, |
191 | - close1 () { | |
242 | + close1() { | |
192 | 243 | this.dialog1 = false; |
193 | 244 | setTimeout(() => { |
194 | 245 | this.editedItem = Object.assign({}, this.defaultItem); |
195 | 246 | this.editedIndex = -1; |
196 | 247 | }, 300); |
197 | 248 | }, |
198 | - save () { | |
199 | - console.log('editedItem', this.editedItem); | |
249 | + save() { | |
250 | + console.log("editedItem", this.editedItem); | |
200 | 251 | if (this.editedIndex > -1) { |
201 | 252 | Object.assign(this.desserts[this.editedIndex], this.editedItem); |
202 | 253 | } else { |
... | ... | @@ -204,8 +255,8 @@ export default { |
204 | 255 | } |
205 | 256 | this.close(); |
206 | 257 | }, |
207 | - save1 () { | |
208 | - console.log('editedItem', this.editedItem); | |
258 | + save1() { | |
259 | + console.log("editedItem", this.editedItem); | |
209 | 260 | if (this.editedIndex > -1) { |
210 | 261 | Object.assign(this.desserts[this.editedIndex], this.editedItem); |
211 | 262 | } else { |
... | ... | @@ -213,17 +264,16 @@ export default { |
213 | 264 | } |
214 | 265 | this.close1(); |
215 | 266 | } |
216 | - }, | |
267 | + } | |
217 | 268 | // switchComponent (comp) { |
218 | 269 | // this.$emit('switchComp', comp); |
219 | 270 | // } |
220 | 271 | }; |
221 | 272 | </script> |
222 | 273 | <style> |
223 | -#td{ | |
224 | - border: 1px solid #dddddd; | |
225 | - text-align: left; | |
226 | - padding: 8px; | |
227 | - | |
274 | +#td { | |
275 | + border: 1px solid #dddddd; | |
276 | + text-align: left; | |
277 | + padding: 8px; | |
228 | 278 | } |
229 | 279 | </style> | ... | ... |
src/pages/Dashboard.vue
... | ... | @@ -384,14 +384,19 @@ |
384 | 384 | <label class="right">Country:</label> |
385 | 385 | </v-flex> |
386 | 386 | <v-flex xs6 class="ml-3"> |
387 | - <v-text-field | |
387 | + <!-- <v-text-field | |
388 | 388 | placeholder="fill your country Name" |
389 | 389 | :rules="countryRules" |
390 | 390 | v-model="editedItem.country" |
391 | 391 | type="text" |
392 | 392 | name="country" |
393 | 393 | required |
394 | - ></v-text-field> | |
394 | + ></v-text-field> --> | |
395 | + <v-select | |
396 | + v-model="editedItem.country" | |
397 | + :items="countries" | |
398 | + label="fill your country Name" | |
399 | + ></v-select> | |
395 | 400 | </v-flex> |
396 | 401 | </v-layout> |
397 | 402 | <v-layout> |
... | ... | @@ -511,6 +516,7 @@ export default { |
511 | 516 | loading3: false, |
512 | 517 | loading4: false, |
513 | 518 | details: [], |
519 | + countries:['US','Canada'], | |
514 | 520 | AddUsercredentials: {}, |
515 | 521 | pagination: { |
516 | 522 | rowsPerPage: 15 |
... | ... | @@ -557,6 +563,7 @@ export default { |
557 | 563 | name: "", |
558 | 564 | lastname: "", |
559 | 565 | email: "", |
566 | + date: null, | |
560 | 567 | dob: "" |
561 | 568 | }, |
562 | 569 | userName:'', |
... | ... | @@ -692,7 +699,7 @@ export default { |
692 | 699 | if (this.$refs.form.validate()) { |
693 | 700 | let addUsers = { |
694 | 701 | name: this.editedItem.name + " " +this.editedItem.lastname, |
695 | - dob: this.editedItem.dob, | |
702 | + dob: this.editedItem.date, | |
696 | 703 | email: this.editedItem.email, |
697 | 704 | country: this.editedItem.country |
698 | 705 | }; | ... | ... |
src/pages/questions.vue
1 | 1 | <template> |
2 | 2 | <v-flex> |
3 | - <app-toolbar class="app--toolbar"></app-toolbar> | |
4 | - <v-card> | |
3 | + <app-toolbar class="app--toolbar"></app-toolbar> | |
4 | + <v-card> | |
5 | 5 | <v-toolbar flat color="white"> |
6 | - <v-card-title> | |
7 | - <h3 style="position:relative; left:px; top:-5px;"><b>Forum Questions</b></h3> | |
8 | - <h5 style="position:relative; left:40px; top:-15px;">Select Category</h5> | |
9 | - <span style="position:relative; left:-95px; top:10px;"> | |
10 | - | |
6 | + <v-card-title> | |
7 | + <!-- <h3 style="position:relative; left:0px; top:-5px;"><b>Forum Questions</b></h3> --> | |
8 | + <h3><b>Forum Questions</b></h3> | |
9 | + <h5 style="position:relative;top:-15px;">Select Category</h5> | |
10 | + <!-- <span style="position:relative; left:-95px; top:10px;"> --> | |
11 | 11 | <v-btn color="grey darken-2" v-on:click="component='suggestion' , activebtn('existing')" v-bind:class="{ activebtn: isActivebtn }" flat>Suggestion</v-btn> |
12 | 12 | |
13 | 13 | <v-btn color="grey darken-2" v-on:click="component='sex' , activebtn('new')" v-bind:class="{ activebtn: Activebtn1 }" flat>Sex</v-btn> |
... | ... | @@ -17,10 +17,8 @@ |
17 | 17 | <v-btn color="grey darken-2" v-on:click="component='skin' , activebtn('new2')" v-bind:class="{ activebtn: Activebtn3 }" flat>Skin & Beauty</v-btn> |
18 | 18 | |
19 | 19 | <v-btn color="grey darken-2" v-on:click="component='diet' , activebtn('new3')" v-bind:class="{ activebtn: Activebtn4 }" flat>Diet & Ex</v-btn> |
20 | - | |
21 | - </span> | |
22 | - </v-card-title> | |
23 | - | |
20 | + | |
21 | + </v-card-title> | |
24 | 22 | </v-toolbar> |
25 | 23 | <component v-bind:is="component"></component> |
26 | 24 | </v-card> | ... | ... |