diff --git a/.eslintrc.js b/.eslintrc.js index 4c4e02c4acb40..eb62b18dcff23 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,6 +4,7 @@ module.exports = { '@nuxtjs/eslint-config-typescript', 'prettier', 'plugin:prettier/recommended', + 'chartjs', ], rules: { 'vue/max-attributes-per-line': 'off', @@ -30,5 +31,6 @@ module.exports = { patterns: ['./', '../'], }, ], + 'chartjs/for-direction': 'off', }, } diff --git a/assets/json/cardRoutesSettings.json b/assets/json/cardRoutesSettings.json new file mode 100644 index 0000000000000..ac8c90a529aba --- /dev/null +++ b/assets/json/cardRoutesSettings.json @@ -0,0 +1,184 @@ +[ + { + "path": "/cards/infection-medical-care-provision-status", + "title": "本日の感染状況・医療提供体制", + "category": "注目の指標", + "ogpWidth": 959, + "ogpHeight": 500 + }, + { + "path": "/cards/details-of-confirmed-cases", + "title": "検査陽性者の状況", + "category": "注目の指標", + "ogpWidth": 959, + "ogpHeight": 500 + }, + { + "path": "/cards/monitoring-comment", + "title": "感染状況・医療提供体制の分析", + "category": "注目の指標", + "ogpWidth": 959, + "ogpHeight": 500 + }, + { + "path": "/cards/vaccination", + "title": "ワクチン接種数(累計)", + "category": "注目の指標", + "ogpWidth": 959, + "ogpHeight": 730 + }, + { + "path": "/cards/number-of-confirmed-cases", + "title": "報告日別による陽性者数の推移", + "category": "注目の指標", + "ogpWidth": 959, + "ogpHeight": 500 + }, + { + "path": "/cards/number-of-tested", + "title": "検査実施件数", + "category": "注目の指標", + "ogpWidth": 959, + "ogpHeight": 540 + }, + { + "path": "/cards/number-of-reports-to-tokyo-fever-consultation-center", + "title": "東京都発熱相談センターにおける相談件数", + "category": "注目の指標", + "ogpWidth": 959, + "ogpHeight": 570 + }, + { + "path": "/cards/number-of-reports-to-covid19-telephone-advisory-center", + "title": "新型コロナコールセンター相談件数", + "category": "注目の指標", + "ogpWidth": 959, + "ogpHeight": 500 + }, + { + "path": "/cards/monitoring-items-overview", + "title": "モニタリング項目", + "category": "モニタリング項目", + "ogpWidth": 959, + "ogpHeight": 570 + }, + { + "path": "/cards/monitoring-number-of-confirmed-cases", + "title": "モニタリング項目(1)新規陽性者数", + "category": "モニタリング項目", + "ogpWidth": 959, + "ogpHeight": 500 + }, + { + "path": "/cards/number-of-reports-to-consultations-about-fever-in-7119", + "title": "モニタリング項目(2)#7119における発熱等相談件数", + "category": "モニタリング項目", + "ogpWidth": 959, + "ogpHeight": 500 + }, + { + "path": "/cards/untracked-rate", + "title": "モニタリング項目(3)新規陽性者における接触歴等不明者数", + "category": "モニタリング項目", + "ogpWidth": 959, + "ogpHeight": 500 + }, + { + "path": "/cards/positive-rate", + "title": "モニタリング項目(4)検査の陽性率", + "category": "モニタリング項目", + "ogpWidth": 959, + "ogpHeight": 730 + }, + { + "path": "/cards/number-of-tokyo-rules-applied", + "title": "モニタリング項目(5)救急医療の東京ルールの適用件数", + "category": "モニタリング項目", + "ogpWidth": 959, + "ogpHeight": 500 + }, + { + "path": "/cards/number-of-hospitalized", + "title": "モニタリング項目(6)入院患者数", + "category": "モニタリング項目", + "ogpWidth": 959, + "ogpHeight": 500 + }, + { + "path": "/cards/positive-status-severe-case", + "title": "モニタリング項目(7)重症患者数", + "category": "モニタリング項目", + "ogpWidth": 959, + "ogpHeight": 500 + }, + { + "path": "/cards/attributes-of-confirmed-cases", + "title": "陽性者の属性", + "category": "その他 参考指標", + "ogpWidth": 959, + "ogpHeight": 480 + }, + { + "path": "/cards/number-of-confirmed-cases-by-municipalities", + "title": "陽性者数(区市町村別)", + "category": "その他 参考指標", + "ogpWidth": 959, + "ogpHeight": 480 + }, + { + "path": "/cards/positive-number-over65", + "title": "報告日別による陽性者数(65歳以上)の推移", + "category": "その他 参考指標", + "ogpWidth": 959, + "ogpHeight": 570 + }, + { + "path": "/cards/positive-number-by-developed-date", + "title": "発症日別による陽性者数の推移", + "category": "その他 参考指標", + "ogpWidth": 959, + "ogpHeight": 570 + }, + { + "path": "/cards/positive-number-by-diagnosed-date", + "title": "確定日別による陽性者数の推移", + "category": "その他 参考指標", + "ogpWidth": 959, + "ogpHeight": 570 + }, + { + "path": "/cards/deaths-by-death-date", + "title": "死亡日別による死亡者数の推移", + "category": "その他 参考指標", + "ogpWidth": 959, + "ogpHeight": 570 + }, + { + "path": "/cards/variant", + "title": "L452R変異株スクリーニングの実施状況", + "category": "その他 参考指標", + "ogpWidth": 959, + "ogpHeight": 730 + }, + { + "path": "/cards/predicted-number-of-toei-subway-passengers", + "title": "都営地下鉄の利用者数の推移", + "category": "その他 参考指標", + "ogpWidth": 959, + "ogpHeight": 570 + }, + { + "path": "/cards/agency", + "title": "都庁来庁者数の推移", + "category": "その他 参考指標", + "ogpWidth": 959, + "ogpHeight": 570 + }, + { + "path": "/cards/monitoring-number-of-reports-to-covid19-consultation-desk", + "title": "受診相談窓口における相談件数", + "category": "その他 参考指標", + "ogpWidth": 959, + "ogpHeight": 500 + } +] diff --git a/components/_shared/AppLink.vue b/components/_shared/AppLink.vue index 94142383c02af..70dc5dac1626e 100644 --- a/components/_shared/AppLink.vue +++ b/components/_shared/AppLink.vue @@ -70,13 +70,12 @@ export default Vue.extend({ target: '_blank', rel: 'noopener noreferrer', class: 'ExternalLink', - } - } else { - return { - to: this.to, - class: 'Link', - } + }; } + return { + to: this.to, + class: 'Link', + }; }, _showIcon(): boolean { // 指定がない場合、外部なら表示、内部なら表示しない diff --git a/components/_shared/CustomExpansionPanel.vue b/components/_shared/CustomExpansionPanel.vue new file mode 100644 index 0000000000000..3ba2739c5d8ab --- /dev/null +++ b/components/_shared/CustomExpansionPanel.vue @@ -0,0 +1,127 @@ + + + + + diff --git a/components/_shared/SideNavigation/MenuListContents.vue b/components/_shared/SideNavigation/MenuListContents.vue new file mode 100644 index 0000000000000..d5af22fe4aa75 --- /dev/null +++ b/components/_shared/SideNavigation/MenuListContents.vue @@ -0,0 +1,143 @@ + + + + + diff --git a/components/index/CardsFeatured.vue b/components/index/CardsFeatured.vue new file mode 100644 index 0000000000000..ecbf7d4be0712 --- /dev/null +++ b/components/index/CardsFeatured.vue @@ -0,0 +1,65 @@ + + + diff --git a/components/index/CardsFeatured/ConfirmedCasesDetails/Card.vue b/components/index/CardsFeatured/ConfirmedCasesDetails/Card.vue new file mode 100644 index 0000000000000..a26a5971bdff5 --- /dev/null +++ b/components/index/CardsFeatured/ConfirmedCasesDetails/Card.vue @@ -0,0 +1,113 @@ + + + + + diff --git a/components/index/CardsFeatured/ConfirmedCasesDetails/Table.vue b/components/index/CardsFeatured/ConfirmedCasesDetails/Table.vue new file mode 100644 index 0000000000000..f43c821997ed5 --- /dev/null +++ b/components/index/CardsFeatured/ConfirmedCasesDetails/Table.vue @@ -0,0 +1,314 @@ + + + + + diff --git a/components/index/CardsFeatured/ConfirmedCasesNumber/Card.vue b/components/index/CardsFeatured/ConfirmedCasesNumber/Card.vue new file mode 100644 index 0000000000000..b9340c903037e --- /dev/null +++ b/components/index/CardsFeatured/ConfirmedCasesNumber/Card.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/components/index/CardsFeatured/InfectionMedicalCareProvisionStatus/Card.vue b/components/index/CardsFeatured/InfectionMedicalCareProvisionStatus/Card.vue new file mode 100644 index 0000000000000..fd74f01689722 --- /dev/null +++ b/components/index/CardsFeatured/InfectionMedicalCareProvisionStatus/Card.vue @@ -0,0 +1,129 @@ + + + + + diff --git a/components/index/CardsFeatured/InfectionMedicalCareProvisionStatus/Table/InfectionStatus.vue b/components/index/CardsFeatured/InfectionMedicalCareProvisionStatus/Table/InfectionStatus.vue new file mode 100644 index 0000000000000..d38a15515c7fc --- /dev/null +++ b/components/index/CardsFeatured/InfectionMedicalCareProvisionStatus/Table/InfectionStatus.vue @@ -0,0 +1,86 @@ + + + + + diff --git a/components/index/CardsFeatured/MonitoringComment/Card.vue b/components/index/CardsFeatured/MonitoringComment/Card.vue new file mode 100644 index 0000000000000..6d8df580fd718 --- /dev/null +++ b/components/index/CardsFeatured/MonitoringComment/Card.vue @@ -0,0 +1,162 @@ + + + + + diff --git a/components/index/CardsFeatured/MonitoringComment/Frame.vue b/components/index/CardsFeatured/MonitoringComment/Frame.vue new file mode 100644 index 0000000000000..4bd1518b1141a --- /dev/null +++ b/components/index/CardsFeatured/MonitoringComment/Frame.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/components/index/CardsFeatured/MonitoringComment/RandomImage.vue b/components/index/CardsFeatured/MonitoringComment/RandomImage.vue new file mode 100644 index 0000000000000..7ca4733d2ba65 --- /dev/null +++ b/components/index/CardsFeatured/MonitoringComment/RandomImage.vue @@ -0,0 +1,49 @@ + + + + + diff --git a/components/index/CardsFeatured/TelephoneAdvisoryReportsNumber/Card.vue b/components/index/CardsFeatured/TelephoneAdvisoryReportsNumber/Card.vue new file mode 100644 index 0000000000000..8e81d1c97ae13 --- /dev/null +++ b/components/index/CardsFeatured/TelephoneAdvisoryReportsNumber/Card.vue @@ -0,0 +1,39 @@ + + + diff --git a/components/index/CardsFeatured/TestedNumber/Card.vue b/components/index/CardsFeatured/TestedNumber/Card.vue new file mode 100644 index 0000000000000..cb6c06eade7f0 --- /dev/null +++ b/components/index/CardsFeatured/TestedNumber/Card.vue @@ -0,0 +1,136 @@ + + + + + diff --git a/components/index/CardsFeatured/TestedNumber/Chart.vue b/components/index/CardsFeatured/TestedNumber/Chart.vue new file mode 100644 index 0000000000000..31cfb42154e02 --- /dev/null +++ b/components/index/CardsFeatured/TestedNumber/Chart.vue @@ -0,0 +1,647 @@ + + + + + diff --git a/components/index/CardsFeatured/TokyoFeverConsultationCenterReportsNumber/Card.vue b/components/index/CardsFeatured/TokyoFeverConsultationCenterReportsNumber/Card.vue new file mode 100644 index 0000000000000..b115431e8cfb2 --- /dev/null +++ b/components/index/CardsFeatured/TokyoFeverConsultationCenterReportsNumber/Card.vue @@ -0,0 +1,114 @@ + + + diff --git a/components/index/CardsFeatured/TokyoFeverConsultationCenterReportsNumber/Chart.vue b/components/index/CardsFeatured/TokyoFeverConsultationCenterReportsNumber/Chart.vue new file mode 100644 index 0000000000000..2b47fa1f87306 --- /dev/null +++ b/components/index/CardsFeatured/TokyoFeverConsultationCenterReportsNumber/Chart.vue @@ -0,0 +1,572 @@ + + + + + diff --git a/components/index/CardsFeatured/Vaccination/Card.vue b/components/index/CardsFeatured/Vaccination/Card.vue new file mode 100644 index 0000000000000..f27759d3e6710 --- /dev/null +++ b/components/index/CardsFeatured/Vaccination/Card.vue @@ -0,0 +1,150 @@ + + + + + diff --git a/components/index/CardsFeatured/Vaccination/Chart.vue b/components/index/CardsFeatured/Vaccination/Chart.vue new file mode 100644 index 0000000000000..ba001fdc49e89 --- /dev/null +++ b/components/index/CardsFeatured/Vaccination/Chart.vue @@ -0,0 +1,518 @@ + + + + + diff --git a/components/index/CardsMonitoring/HospitalizedNumber/Chart.vue b/components/index/CardsMonitoring/HospitalizedNumber/Chart.vue index d1036c213ca62..8ee08c5fad372 100644 --- a/components/index/CardsMonitoring/HospitalizedNumber/Chart.vue +++ b/components/index/CardsMonitoring/HospitalizedNumber/Chart.vue @@ -459,14 +459,21 @@ const options: ThisTypedComponentOptionsWithRecordProps< }, }, mounted() { - const barChart = this.$refs.barChart as Vue - const barElement = barChart.$el - const canvas = barElement.querySelector('canvas') - const labelledbyId = `${this.titleId}-graph` + const canvas = this.$refs.barChart as Element if (canvas) { - canvas.setAttribute('role', 'img') - canvas.setAttribute('aria-labelledby', labelledbyId) + try { + canvas.setAttribute('role', 'img') + } catch (e) { + } finally { + } + + const labelledbyId = `${this.titleId}-graph` + try { + canvas.setAttribute('aria-labelledby', labelledbyId) + } catch (e) { + } finally { + } } }, } diff --git a/components/index/CardsMonitoring/MonitoringConfirmedCasesNumber/Chart.vue b/components/index/CardsMonitoring/MonitoringConfirmedCasesNumber/Chart.vue index fff53a5f0bbc0..b4764e9e540ed 100644 --- a/components/index/CardsMonitoring/MonitoringConfirmedCasesNumber/Chart.vue +++ b/components/index/CardsMonitoring/MonitoringConfirmedCasesNumber/Chart.vue @@ -498,14 +498,21 @@ const options: ThisTypedComponentOptionsWithRecordProps< }, }, mounted() { - const barChart = this.$refs.barChart as Vue - const barElement = barChart.$el - const canvas = barElement.querySelector('canvas') - const labelledbyId = `${this.titleId}-graph` + const canvas = this.$refs.barChart as Element if (canvas) { - canvas.setAttribute('role', 'img') - canvas.setAttribute('aria-labelledby', labelledbyId) + try { + canvas.setAttribute('role', 'img') + } catch (e) { + } finally { + } + + const labelledbyId = `${this.titleId}-graph` + try { + canvas.setAttribute('aria-labelledby', labelledbyId) + } catch (e) { + } finally { + } } }, } diff --git a/components/index/CardsMonitoring/PositiveRate/Card.vue b/components/index/CardsMonitoring/PositiveRate/Card.vue index e51b392aed956..4bf0f86ed6e99 100644 --- a/components/index/CardsMonitoring/PositiveRate/Card.vue +++ b/components/index/CardsMonitoring/PositiveRate/Card.vue @@ -124,14 +124,13 @@ export default { const getFormatter = (columnIndex) => { if (columnIndex === 4) { // 検査人数(7日間移動平均)は小数点第1位まで表示し、整数部分は3桁区切りにする。 - return getCommaSeparatedNumberToFixedFunction(1) + return getCommaSeparatedNumberToFixedFunction(1); } else if (columnIndex === 5) { // 陽性率は小数点第1位まで表示する。 - return getNumberToFixedFunction(1) - } else { - return getNumberToLocaleStringFunction() + return getNumberToFixedFunction(1); } - } + return getNumberToLocaleStringFunction(); + }; return { PositiveRate, diff --git a/components/index/CardsMonitoring/PositiveRate/Chart.vue b/components/index/CardsMonitoring/PositiveRate/Chart.vue index 5da313ba26a4b..a15e4108c87a3 100644 --- a/components/index/CardsMonitoring/PositiveRate/Chart.vue +++ b/components/index/CardsMonitoring/PositiveRate/Chart.vue @@ -693,14 +693,21 @@ const options: ThisTypedComponentOptionsWithRecordProps< }, }, mounted() { - const barChart = this.$refs.barChart as Vue - const barElement = barChart.$el - const canvas = barElement.querySelector('canvas') - const labelledbyId = `${this.titleId}-graph` + const canvas = this.$refs.barChart as Element if (canvas) { - canvas.setAttribute('role', 'img') - canvas.setAttribute('aria-labelledby', labelledbyId) + try { + canvas.setAttribute('role', 'img') + } catch (e) { + } finally { + } + + const labelledbyId = `${this.titleId}-graph` + try { + canvas.setAttribute('aria-labelledby', labelledbyId) + } catch (e) { + } finally { + } } }, } diff --git a/components/index/CardsMonitoring/SevereCase/Chart.vue b/components/index/CardsMonitoring/SevereCase/Chart.vue index 63d2ee0429891..58fc3921f08ed 100644 --- a/components/index/CardsMonitoring/SevereCase/Chart.vue +++ b/components/index/CardsMonitoring/SevereCase/Chart.vue @@ -399,14 +399,21 @@ const options: ThisTypedComponentOptionsWithRecordProps< }, }, mounted() { - const barChart = this.$refs.barChart as Vue - const barElement = barChart.$el - const canvas = barElement.querySelector('canvas') - const labelledbyId = `${this.titleId}-graph` + const canvas = this.$refs.barChart as Element if (canvas) { - canvas.setAttribute('role', 'img') - canvas.setAttribute('aria-labelledby', labelledbyId) + try { + canvas.setAttribute('role', 'img') + } catch (e) { + } finally { + } + + const labelledbyId = `${this.titleId}-graph` + try { + canvas.setAttribute('aria-labelledby', labelledbyId) + } catch (e) { + } finally { + } } }, } diff --git a/components/index/CardsMonitoring/UntrackedRate/Chart.vue b/components/index/CardsMonitoring/UntrackedRate/Chart.vue index dd24c90143093..8a608aac69346 100644 --- a/components/index/CardsMonitoring/UntrackedRate/Chart.vue +++ b/components/index/CardsMonitoring/UntrackedRate/Chart.vue @@ -656,14 +656,21 @@ const options: ThisTypedComponentOptionsWithRecordProps< }, }, mounted() { - const barChart = this.$refs.barChart as Vue - const barElement = barChart.$el - const canvas = barElement.querySelector('canvas') - const labelledbyId = `${this.titleId}-graph` + const canvas = this.$refs.barChart as Element if (canvas) { - canvas.setAttribute('role', 'img') - canvas.setAttribute('aria-labelledby', labelledbyId) + try { + canvas.setAttribute('role', 'img') + } catch (e) { + } finally { + } + + const labelledbyId = `${this.titleId}-graph` + try { + canvas.setAttribute('aria-labelledby', labelledbyId) + } catch (e) { + } finally { + } } }, } diff --git a/components/index/CardsReference/Agency/Chart.vue b/components/index/CardsReference/Agency/Chart.vue index cabe1eb862699..8952f7e7bfc4b 100644 --- a/components/index/CardsReference/Agency/Chart.vue +++ b/components/index/CardsReference/Agency/Chart.vue @@ -381,14 +381,21 @@ const options: ThisTypedComponentOptionsWithRecordProps< }, }, mounted() { - const barChart = this.$refs.barChart as Vue - const barElement = barChart.$el - const canvas = barElement.querySelector('canvas') - const labelledbyId = `${this.titleId}-graph` + const canvas = this.$refs.barChart as Element if (canvas) { - canvas.setAttribute('role', 'img') - canvas.setAttribute('aria-labelledby', labelledbyId) + try { + canvas.setAttribute('role', 'img') + } catch (e) { + } finally { + } + + const labelledbyId = `${this.titleId}-graph` + try { + canvas.setAttribute('aria-labelledby', labelledbyId) + } catch (e) { + } finally { + } } }, } diff --git a/components/index/CardsReference/ConfirmedCasesAttributes/Card.vue b/components/index/CardsReference/ConfirmedCasesAttributes/Card.vue index 014f2dbb83221..c7663f629a01d 100644 --- a/components/index/CardsReference/ConfirmedCasesAttributes/Card.vue +++ b/components/index/CardsReference/ConfirmedCasesAttributes/Card.vue @@ -177,7 +177,9 @@ const options: ThisTypedComponentOptionsWithRecordProps< }, fetchIfNoCache() { // メモリ上に次ページのデータがなければ先読みしてページネーション時の待ち時間を減らす - if (this.dataMargin <= 0) setTimeout(() => this.$fetch(), 0) + if (this.dataMargin <= 0) { + setTimeout(() => this.$fetch(), 0) + } }, onChangeItemsPerPage(itemsPerPage) { this.itemsPerPage = itemsPerPage @@ -191,7 +193,9 @@ const options: ThisTypedComponentOptionsWithRecordProps< }, translateDate(date) { const day = dayjs(date) - if (!day.isValid()) return date + if (!day.isValid()) { + return date + } return this.$d(day.toDate(), 'date') }, translateAge(_age) { diff --git a/components/index/CardsReference/ConfirmedCasesAttributes/DataTable.vue b/components/index/CardsReference/ConfirmedCasesAttributes/DataTable.vue index c4b0f2a478402..806b974138979 100644 --- a/components/index/CardsReference/ConfirmedCasesAttributes/DataTable.vue +++ b/components/index/CardsReference/ConfirmedCasesAttributes/DataTable.vue @@ -149,14 +149,13 @@ export default Vue.extend({ }, }, mounted() { - const vTables = this.$refs.displayedTable as Vue - const vTableElement = vTables.$el - const tables = vTableElement.querySelectorAll('table') + const vTables = this.$refs.displayedTable as Array // NodeListをIE11でforEachするためのワークアラウンド - const nodes = Array.prototype.slice.call(tables, 0) - nodes.forEach((table: HTMLElement) => { - table.setAttribute('tabindex', '0') - }) + if (vTables.length > 0) { + vTables.forEach((elem: Element) => { + elem.setAttribute('tabindex', '0'); + }); + } }, }) diff --git a/components/index/CardsReference/ConfirmedCasesByMunicipalities/Card.vue b/components/index/CardsReference/ConfirmedCasesByMunicipalities/Card.vue index 2abd55285070c..e41f40a3174b2 100644 --- a/components/index/CardsReference/ConfirmedCasesByMunicipalities/Card.vue +++ b/components/index/CardsReference/ConfirmedCasesByMunicipalities/Card.vue @@ -72,12 +72,11 @@ export default { .sort((a, b) => { // 全体をふりがなでソート if (a.ruby === b.ruby) { - return 0 + return 0; } else if (a.ruby > b.ruby) { - return 1 - } else { - return -1 + return 1; } + return -1; }) .sort((a, b) => { // '特別区' -> '多摩地域' -> '島しょ地域' -> その他 の順にソート @@ -88,17 +87,16 @@ export default { municipalitiesTable.datasets = datasets.data .filter((d) => d.label !== '小計') .map((d) => { - const area = this.$t(d.area) - const label = this.$t(d.label) - const count = countFormatter(d.count) + const area = this.$t(d.area); + const label = this.$t(d.label); + const count = countFormatter(d.count); if (this.$i18n.locale === 'ja') { - const ruby = this.$t(d.ruby) - return { area, ruby, label, count } - } else { - return { area, label, count } + const ruby = this.$t(d.ruby); + return {area, ruby, label, count}; } - }) + return {area, label, count}; + }); const info = { sText: this.$t('{date}の累計', { diff --git a/components/index/CardsReference/ConfirmedCasesByMunicipalities/Table.vue b/components/index/CardsReference/ConfirmedCasesByMunicipalities/Table.vue index 27829ea5e0675..87468384fda78 100644 --- a/components/index/CardsReference/ConfirmedCasesByMunicipalities/Table.vue +++ b/components/index/CardsReference/ConfirmedCasesByMunicipalities/Table.vue @@ -64,14 +64,13 @@ export default Vue.extend({ }, }, mounted() { - const vTables = this.$refs.displayedTable as Vue - const vTableElement = vTables.$el - const tables = vTableElement.querySelectorAll('table') + const vTables = this.$refs.displayedTable as Array // NodeListをIE11でforEachするためのワークアラウンド - const nodes = Array.prototype.slice.call(tables, 0) - nodes.forEach((table: HTMLElement) => { - table.setAttribute('tabindex', '0') - }) + if (vTables.length > 0) { + vTables.forEach((elem: Element) => { + elem.setAttribute('tabindex', '0'); + }); + } }, }) diff --git a/components/index/CardsReference/Metro/Chart.vue b/components/index/CardsReference/Metro/Chart.vue index cbbcfac40c93e..9a02414c0f320 100644 --- a/components/index/CardsReference/Metro/Chart.vue +++ b/components/index/CardsReference/Metro/Chart.vue @@ -400,14 +400,21 @@ const options: ThisTypedComponentOptionsWithRecordProps< }, }, mounted() { - const barChart = this.$refs.barChart as Vue - const barElement = barChart.$el - const canvas = barElement.querySelector('canvas') - const labelledbyId = `${this.titleId}-graph` + const canvas = this.$refs.barChart as Element if (canvas) { - canvas.setAttribute('role', 'img') - canvas.setAttribute('aria-labelledby', labelledbyId) + try { + canvas.setAttribute('role', 'img') + } catch (e) { + } finally { + } + + const labelledbyId = `${this.titleId}-graph` + try { + canvas.setAttribute('aria-labelledby', labelledbyId) + } catch (e) { + } finally { + } } }, } diff --git a/components/index/CardsReference/MonitoringConsultationDeskReportsNumber/Chart.vue b/components/index/CardsReference/MonitoringConsultationDeskReportsNumber/Chart.vue index a3a15afab97ea..3754d19191ee2 100644 --- a/components/index/CardsReference/MonitoringConsultationDeskReportsNumber/Chart.vue +++ b/components/index/CardsReference/MonitoringConsultationDeskReportsNumber/Chart.vue @@ -33,12 +33,12 @@

{{ $t(`{title}のグラフ`, { title }) }}

- +