33 class =" table-fixed"
44 ref =" multipleTable"
55 empty-text =" 資料包中無此區資料"
6- :span-method =" arraySpanMethod"
76 :data =" storageTableData"
87 height =" 100%"
98 size =" small"
6968export 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
0 commit comments