|
@@ -15,7 +15,7 @@
|
|
|
<el-button type="primary" plain @click="pageProps = { ...initProps }">
|
|
|
重置
|
|
|
</el-button>
|
|
|
- <el-button type="primary" @click="addHandler"> 创建用户 </el-button>
|
|
|
+ <el-button v-if="isSuper" type="primary" @click="addHandler"> 创建用户 </el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -45,7 +45,7 @@
|
|
|
<el-button link type="primary" @click="editHandler(row)" size="small">
|
|
|
编辑
|
|
|
</el-button>
|
|
|
- <el-button link type="danger" @click="delHandler(row)" size="small" v-if="!isMe(row.userId)">
|
|
|
+ <el-button link type="danger" @click="delHandler(row)" size="small" v-if="!isMe(row.userId) && isSuper">
|
|
|
删除
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -77,11 +77,12 @@ import { ElMessageBox } from "element-plus";
|
|
|
import { debounce } from "@/util";
|
|
|
import { user } from "@/store/user";
|
|
|
|
|
|
-const isSuper = computed(() => user.value.roles.filter(item => item.roleKey === "super_admin").length > 0)
|
|
|
+const isSuper = computed(() => user.value.roles.filter(item => ['super_admin', 'system_admin'].includes(item.roleKey)).length > 0)
|
|
|
+
|
|
|
const isMe = computed(() => (id: any) => {
|
|
|
return id === user.value.userId
|
|
|
})
|
|
|
-console.log('isSuper', isSuper)
|
|
|
+
|
|
|
const initProps: PageProps<Partial<Pick<UserType, "userName" | "orgName">>> = {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|