@@ -96,8 +93,7 @@ $--input-focus-border: red;
export default {
name: 'accountBox',
props: {
- user: Object,
- roles: Array
+ user: Object
},
computed: {
isCurrentUser () {
@@ -159,7 +155,8 @@ export default {
editUser: {},
scripts: [],
selectableScripts: [],
- pinChange: ''
+ pinChange: '',
+ roles: []
}
},
methods: {
@@ -241,14 +238,6 @@ export default {
this.scripts = response.data.list
this.getSelectableScripts()
})
- /* this.scripts = [
- {id: 1, name: "DOLBY"},
- {id: 2, name: "IMAX"},
- {id: 3, name: "CGS"},
- {id: 4, name: "LUXE"},
- {id: 5, name: "DST:X"},
- ];
- this.getSelectableScripts(); */
},
getSelectableScripts () {
@@ -283,13 +272,23 @@ export default {
this.editUser.notifications.push({ scriptId: scripts.id, account: '' })
}
},
-
+ getRoles () {
+ this.roles = []
+ this.$get('sys/role?pageSize=-1').then(response => {
+ if (response.code === 200) {
+ this.roles = response.data.list
+ } else {
+ this.$message.error('load roles faild')
+ }
+ })
+ },
removeNotification (index) {
this.editUser.notifications.splice(index, 1)
}
},
mounted () {
this.getScripts()
+ this.getRoles()
},
watch: {
// 将prop里的user转为组件内部对象
diff --git a/nezha-fronted/src/components/common/table/settings/menuTable.vue b/nezha-fronted/src/components/common/table/settings/menuTable.vue
new file mode 100644
index 000000000..3a5ab98ad
--- /dev/null
+++ b/nezha-fronted/src/components/common/table/settings/menuTable.vue
@@ -0,0 +1,121 @@
+
+
+
+
+
diff --git a/nezha-fronted/src/components/common/table/settings/roleTable.vue b/nezha-fronted/src/components/common/table/settings/roleTable.vue
new file mode 100644
index 000000000..775aa1cab
--- /dev/null
+++ b/nezha-fronted/src/components/common/table/settings/roleTable.vue
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+ {{item.label}}
+
+
+
+
+
+ {{$t(scope.row.i18n)}}
+
+
+ {{scope.row.name}}
+
+
+ -
+
+
+ {{scope.row[item.prop]}}
+
+
+
+ {{$t('overall.option')}}
+
+
+
+
+ …
+
+
+ {{$t('overall.delete')}}
+
+
+
+
+
+
+
+
diff --git a/nezha-fronted/src/components/common/table/settings/userTable.vue b/nezha-fronted/src/components/common/table/settings/userTable.vue
index f8c01e4ef..7098b396f 100644
--- a/nezha-fronted/src/components/common/table/settings/userTable.vue
+++ b/nezha-fronted/src/components/common/table/settings/userTable.vue
@@ -7,7 +7,7 @@
border
@header-dragend="dragend"
@sort-change="tableDataSort"
- @selection-change="(selection) => { batchDeleteObjs = selection }"
+ @selection-change="selectionChange"
>
{{item.label}}
@@ -70,7 +69,7 @@