|
|
@@ -76,13 +76,13 @@ export default {
|
|
|
{ key: 'probiotic', label: '益生菌' },
|
|
|
{ key: 'harmful', label: '有害菌' },
|
|
|
{ key: 'other', label: '其它菌属' },
|
|
|
- { key: 'pathogen', label: '病原菌' },
|
|
|
- { key: 'obesity', label: '肥胖相关' },
|
|
|
- { key: 'constipation', label: '便秘相关' },
|
|
|
- { key: 'depression', label: '抑郁相关' },
|
|
|
- { key: 'allergy', label: '过敏相关' },
|
|
|
- { key: 'bloating', label: '腹胀相关' },
|
|
|
- { key: 'insomnia', label: '失眠相关' },
|
|
|
+ { key: 'pathogen_genus', label: '病原菌属' },
|
|
|
+ { key: 'pathogen_detection', label: '病原菌检出' },
|
|
|
+ { key: 'taxonomy_class', label: '菌纲' },
|
|
|
+ { key: 'taxonomy_order', label: '菌目' },
|
|
|
+ { key: 'taxonomy_family', label: '菌科' },
|
|
|
+ { key: 'taxonomy_genus', label: '菌属' },
|
|
|
+ { key: 'taxonomy_species', label: '菌种' },
|
|
|
{ key: 'all', label: '全部' }
|
|
|
]
|
|
|
}
|
|
|
@@ -96,13 +96,42 @@ export default {
|
|
|
? this.editFlora.filter(function(i) { return i.category === 'probiotic' })
|
|
|
: this.probioticSpecies
|
|
|
}
|
|
|
- return list.filter(function(item) {
|
|
|
- return item.category === this.selectedTab
|
|
|
- }.bind(this))
|
|
|
+ // Taxonomy tabs: filter by category='taxonomy' + level
|
|
|
+ if (this.selectedTab.indexOf('taxonomy_') === 0) {
|
|
|
+ var levelMap = {
|
|
|
+ 'taxonomy_class': 'CLASS',
|
|
|
+ 'taxonomy_order': 'ORDER',
|
|
|
+ 'taxonomy_family': 'FAMILY',
|
|
|
+ 'taxonomy_genus': 'GENUS',
|
|
|
+ 'taxonomy_species': 'SPECIES'
|
|
|
+ }
|
|
|
+ var targetLevel = levelMap[this.selectedTab]
|
|
|
+ return list.filter(function(item) {
|
|
|
+ return item.category === 'taxonomy' && item.level === targetLevel
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // Other category tabs: filter by category field
|
|
|
+ var categoryMap = {
|
|
|
+ 'core': 'core',
|
|
|
+ 'harmful': 'harmful',
|
|
|
+ 'other': 'other',
|
|
|
+ 'pathogen_genus': 'pathogen_genus',
|
|
|
+ 'pathogen_detection': 'pathogen_detection'
|
|
|
+ }
|
|
|
+ var targetCategory = categoryMap[this.selectedTab]
|
|
|
+ if (targetCategory) {
|
|
|
+ return list.filter(function(item) {
|
|
|
+ return item.category === targetCategory
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return []
|
|
|
}
|
|
|
},
|
|
|
onLoad: function(options) {
|
|
|
this.reportId = options.reportId ? parseInt(options.reportId) : null
|
|
|
+ if (options.tab) {
|
|
|
+ this.selectedTab = options.tab
|
|
|
+ }
|
|
|
if (this.reportId) {
|
|
|
this.loadData()
|
|
|
}
|