|
@@ -45,7 +45,7 @@
|
|
<el-button link type="primary" @click="editHandler(row)" size="small">
|
|
<el-button link type="primary" @click="editHandler(row)" size="small">
|
|
编辑
|
|
编辑
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button link type="danger" @click="delHandler(row)" size="small">
|
|
|
|
|
|
+ <el-button link type="danger" @click="delHandler(row)" size="small" v-if="isSuper">
|
|
删除
|
|
删除
|
|
</el-button>
|
|
</el-button>
|
|
</template>
|
|
</template>
|
|
@@ -61,7 +61,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
-import { onActivated, ref, watch } from "vue";
|
|
|
|
|
|
+import { onActivated, ref, watch, computed } from "vue";
|
|
import {
|
|
import {
|
|
getUserpageFetch,
|
|
getUserpageFetch,
|
|
addUserFetch,
|
|
addUserFetch,
|
|
@@ -75,7 +75,10 @@ import { usersAdd, usersEdit } from "./quisk";
|
|
import { openLoading, closeLoading } from "@/helper/loading";
|
|
import { openLoading, closeLoading } from "@/helper/loading";
|
|
import { ElMessageBox } from "element-plus";
|
|
import { ElMessageBox } from "element-plus";
|
|
import { debounce } from "@/util";
|
|
import { debounce } from "@/util";
|
|
|
|
+import { user } from "@/store/user";
|
|
|
|
|
|
|
|
+const isSuper = computed(() => user.value.roles.filter(item => item.roleKey === "super_admin").length > 0)
|
|
|
|
+console.log('isSuper', isSuper)
|
|
const initProps: PageProps<Partial<Pick<UserType, "userName" | "orgName">>> = {
|
|
const initProps: PageProps<Partial<Pick<UserType, "userName" | "orgName">>> = {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
@@ -97,7 +100,7 @@ const addHandler = async () => {
|
|
await usersAdd({ submit: addUserFetch });
|
|
await usersAdd({ submit: addUserFetch });
|
|
await refresh();
|
|
await refresh();
|
|
}
|
|
}
|
|
-const editHandler = async(row: UserType) => {
|
|
|
|
|
|
+const editHandler = async (row: UserType) => {
|
|
await usersEdit({ user: row, submit: editUserFetch });
|
|
await usersEdit({ user: row, submit: editUserFetch });
|
|
await refresh();
|
|
await refresh();
|
|
}
|
|
}
|