| | |
| | | |
| | | }, |
| | | roles: [], |
| | | <<<<<<< HEAD |
| | | localizedRoles:[], |
| | | ======= |
| | | |
| | | localizedRoles: [], |
| | | >>>>>>> 36acd690614dd276428530a59f448c543bac52d4 |
| | | |
| | | messagepack: { |
| | | data: { taskname: "" } |
| | | }, |
| | |
| | | |
| | | }, |
| | | methods: { |
| | | <<<<<<< HEAD |
| | | load() { |
| | | setAll().then(res => { |
| | | this.roles = res.data.list; |
| | | const language = this.$i18n.locale; |
| | | if (language === 'zh-CN') { |
| | | this.replaceChineseWithEnglish(); |
| | | } else { |
| | | this.localizedRoles = [...this.roles]; |
| | | } |
| | | console.log(this.localizedRoles); |
| | | }); |
| | | }, |
| | | replaceChineseWithEnglish() { |
| | | const translation = this.$t('translation'); |
| | | this.localizedRoles = this.roles.map(role => ({ |
| | | ...role, |
| | | content: translation[role.content] || role.content |
| | | })); |
| | | }, |
| | | ======= |
| | | |
| | | load () { |
| | | setAll().then(res => { |
| | | this.roles = res.data.list; |
| | |
| | | content: translation[role.content] || role.content |
| | | })); |
| | | }, |
| | | >>>>>>> 36acd690614dd276428530a59f448c543bac52d4 |
| | | |
| | | init () { |
| | | let viewname = "alarm"; |
| | | |