|
@@ -15,7 +15,7 @@
|
|
|
<el-button type="primary" plain @click="pageProps = { ...initProps }">
|
|
|
重置
|
|
|
</el-button>
|
|
|
- <el-button v-if="isSuper" type="primary" @click="addHandler"> 创建用户 </el-button>
|
|
|
+ <el-button v-if="ismanager" 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) && isSuper">
|
|
|
+ <el-button link type="danger" @click="delHandler(row)" size="small" v-if="!isMe(row.userId) && ismanager">
|
|
|
删除
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -77,7 +77,9 @@ import { ElMessageBox } from "element-plus";
|
|
|
import { debounce } from "@/util";
|
|
|
import { user } from "@/store/user";
|
|
|
|
|
|
-const isSuper = computed(() => user.value.roles.filter(item => ['super_admin', 'system_admin'].includes(item.roleKey)).length > 0)
|
|
|
+// const isSuper = computed(() => user.value.roles.filter(item => item.roleKey === "super_admin").length > 0)
|
|
|
+// 不改动他原本的逻辑,新增一个
|
|
|
+const ismanager = 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
|