Skip to content

Commit ad867a7

Browse files
authored
Merge pull request #10 from MyDataTaiwan/rm-FH-template
不顯示 heartFailure 症狀預覽
2 parents aafa3c8 + d150397 commit ad867a7

File tree

2 files changed

+55
-53
lines changed

2 files changed

+55
-53
lines changed

src/components/SymptomTable.vue

Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
class="table-fixed"
44
ref="multipleTable"
55
empty-text="資料包中無此區資料"
6-
:span-method="arraySpanMethod"
76
:data="storageTableData"
87
height="100%"
98
size="small"
@@ -69,12 +68,11 @@
6968
export default {
7069
name: "SymptomTable",
7170
props: {
72-
msg: String,
73-
},
74-
created() {
71+
msg: String
7572
},
73+
created() {},
7674
watch: {
77-
storageTableTitle: function () {
75+
storageTableTitle: function() {
7876
this.$nextTick(() => {
7977
this.$refs.multipleTable.doLayout();
8078
@@ -83,24 +81,23 @@ export default {
8381
this.$refs.multipleTable.$el.style.width = "95%";
8482
console.log("input storageTableTitle change", this.storageTableTitle);
8583
},
86-
storageTableData: function () {
84+
storageTableData: function() {
8785
console.log("input storageTableData change", this.storageTableData);
88-
this.$refs.tableRef.bodyWrapper.scrollTop = 5;
8986
this.$nextTick(() => {
9087
this.$refs.multipleTable.doLayout();
9188
this.$refs.multipleTable.$el.style.width = "95%";
9289
});
9390
this.$refs.multipleTable.$el.style.width = "95%";
9491
},
95-
selectTemplate: function () {
92+
selectTemplate: function() {
9693
this.$nextTick(() => {
9794
this.$refs.multipleTable.doLayout();
9895
this.$refs.multipleTable.$el.style.width = "95%";
9996
});
10097
this.$refs.multipleTable.$el.style.width = "95%";
10198
console.log("selectTemplate change", this.selectTemplate);
10299
},
103-
storageData: function () {
100+
storageData: function() {
104101
this.$nextTick(() => {
105102
this.$refs.multipleTable.doLayout();
106103
@@ -109,50 +106,55 @@ export default {
109106
this.$refs.multipleTable.$el.style.width = "95%";
110107
console.log("input storageData change", this.storageData);
111108
},
112-
storageThumbnailSets: function () {
109+
storageThumbnailSets: function() {
113110
// this.fillData();
114111
console.log("storageThumbnailSets change", this.storageThumbnailSets);
115112
},
116-
storageSymptomsTemplates: function () {
113+
storageSymptomsTemplates: function() {
117114
console.log(
118115
"storageSymptomsTemplates change",
119116
this.storageSymptomsTemplates
120117
);
121-
},
118+
}
122119
},
123120
computed: {
124121
storageThumbnailSets() {
125122
return this.$store.state.thumbnailList;
126123
},
127124
storageSymptomsTemplates() {
128-
if (this.$store.state.selectTemplateSet[0] != null) {
129-
let swp = this.selectTemplate;
130-
let filterDisplayTemplate = this.$store.state.selectTemplateSet.filter(
131-
(item) => {
132-
if (swp == "heartFailure") {
133-
return item.titile == "heartFailure";
134-
} else if (swp == "commonCold") {
135-
return item.titile == "commonCold";
125+
let swp = this.selectTemplate;
126+
127+
// WORKAROUND
128+
if (swp != "heartFailure") {
129+
if (this.$store.state.selectTemplateSet[0] != null) {
130+
let filterDisplayTemplate = this.$store.state.selectTemplateSet.filter(
131+
item => {
132+
if (swp == "heartFailure") {
133+
return item.title == "heartFailure";
134+
} else if (swp == "commonCold") {
135+
return item.title == "commonCold";
136+
}
137+
// return this.storageTableData;
136138
}
137-
// return this.storageTableData;
138-
}
139-
);
140-
////FIXME storage Symptoms Templates
141-
console.log("filter Template", this.selectTemplate);
142-
console.log(
143-
"filterDisplayTemplate",
144-
swp,
145-
filterDisplayTemplate[0].symptoms.slice(1)
146-
);
147-
return filterDisplayTemplate[0].symptoms.slice(1);
139+
);
140+
////FIXME storage Symptoms Templates
141+
console.log("filter Template", this.selectTemplate);
142+
console.log(
143+
"filterDisplayTemplate",
144+
swp,
145+
filterDisplayTemplate[0].symptoms.slice(1)
146+
);
147+
return filterDisplayTemplate[0].symptoms.slice(1);
148+
} else {
149+
return null;
150+
}
148151
} else {
149152
return null;
150153
}
151154
// return this.$store.state.SymptomsTemplates;
152155
},
153156
storageTableTitle() {
154157
console.log("storeTableTitle", this.$store.state.storeTableTitle);
155-
156158
return this.$store.state.storeTableTitle;
157159
},
158160
storageTableData() {
@@ -185,7 +187,7 @@ export default {
185187
// // uid: "4b539876-d395-4e01-b987-8ae8ea754b0e"
186188
// });
187189
return this.$store.state.selectTemplate;
188-
},
190+
}
189191
},
190192
methods: {
191193
ChangDisplayTemplate(payload) {
@@ -195,23 +197,23 @@ export default {
195197
console.log("fetch Templates_200", payload);
196198
console.log(
197199
"SymptomsTemplates0",
198-
this.$store.state.SymptomsTemplates[0].titile
200+
this.$store.state.SymptomsTemplates[0].title
199201
);
200202
console.log(
201203
"SymptomsTemplates0",
202204
this.$store.state.SymptomsTemplates[0].symptoms
203205
);
204206
console.log(
205207
"SymptomsTemplates1",
206-
this.$store.state.SymptomsTemplates[1].titile
208+
this.$store.state.SymptomsTemplates[1].title
207209
);
208210
console.log(
209211
"SymptomsTemplates1",
210212
this.$store.state.SymptomsTemplates[1].symptoms
211213
);
212214
var filterDisplayTemplate = this.$store.state.SymptomsTemplates.filter(
213-
function (item) {
214-
return item.titile == "commonCold"; // 取得大於五歲的
215+
function(item) {
216+
return item.title == "commonCold"; // 取得大於五歲的
215217
}
216218
);
217219
console.log("fetch filterDisplayTemplate", filterDisplayTemplate);
@@ -220,7 +222,7 @@ export default {
220222
console.log("fetch Templates_end");
221223
},
222224
doResize() {
223-
setTimeout(function () {
225+
setTimeout(function() {
224226
//手動觸發窗口resize事件
225227
if (document.createEvent) {
226228
var event = document.createEvent("HTMLEvents");
@@ -235,34 +237,34 @@ export default {
235237
let TableTitle = [];
236238
console.log("TableTitleA", date);
237239
if (date != null) {
238-
date.map((index) => {
240+
date.map(index => {
239241
// console.log(Object.keys(index));
240242
TableTitle.push({
241243
prop: Object.keys(index),
242-
label: Object.keys(index),
244+
label: Object.keys(index)
243245
});
244246
});
245247
}
246248
console.log("TableTitle", Object.keys(TableTitle));
247249
return TableTitle;
248-
},
250+
}
249251
},
250252
data() {
251253
return {
252254
colTitleConfigs: this.TargetDateToTableTitle,
253255
testDB: [
254256
{
255-
name: "sneezing",
257+
name: "sneezing"
256258
},
257259
{
258-
name: "sneezing1",
260+
name: "sneezing1"
259261
},
260262
{
261-
name: "sneezing2",
262-
},
263-
],
263+
name: "sneezing2"
264+
}
265+
]
264266
};
265-
},
267+
}
266268
};
267269
</script>
268270

src/store/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default new Vuex.Store({
5050
storeChartDatasets: [],
5151
templateList: ["heartFailure"],
5252
selectTemplateSet: [{
53-
titile: 'heartFailure', symptoms: [
53+
title: 'heartFailure', symptoms: [
5454
{
5555
"name": "SBP",
5656
"icon": "pulse-outline",
@@ -115,7 +115,7 @@ export default new Vuex.Store({
115115
}
116116
]
117117
}, {
118-
titile: 'commonCold', symptoms: [
118+
title: 'commonCold', symptoms: [
119119
{
120120
"name": "bodyTemperature",
121121
"icon": "thermometer-outline",
@@ -458,7 +458,7 @@ export default new Vuex.Store({
458458
let FormatPhotoSets = null;
459459
if (this.state.selectTemplate == "heartFailure") {
460460
FormatTableData = [];
461-
FormatTableTitle=[];
461+
FormatTableTitle = [];
462462
} else {
463463
FormatTableData = response.data.symptoms;
464464
for (let id = 0; id < response.data.date.length; id++) {
@@ -467,7 +467,7 @@ export default new Vuex.Store({
467467
console.log("DADADADDA", temp)
468468
FormatTableTitle.push({ prop: id + 1, label: temp[1] + "-" + temp[2] })
469469
}
470-
470+
471471
}
472472
console.log("input FormatTableData change", response.data.symptoms);
473473
// FormatTableData = response.data.symptoms;
@@ -601,9 +601,9 @@ export default new Vuex.Store({
601601
console.log("fetch Templates_get", response)
602602
if (response.status === 200) {
603603
console.log(response.data);
604-
let titile = response.data.templateName;
604+
let title = response.data.templateName;
605605
let symptoms = response.data.fields;
606-
SymptomsTemplates.push({ titile: titile, symptoms: symptoms })
606+
SymptomsTemplates.push({ title: title, symptoms: symptoms })
607607
commit('saveSymptomsTemplates', SymptomsTemplates);
608608

609609
} else {

0 commit comments

Comments
 (0)