|
@@ -62,6 +62,7 @@
|
|
|
cardWidth="9rem"
|
|
|
cardHeight="9rem"
|
|
|
:limit="1"
|
|
|
+ :delRule="(file) => true"
|
|
|
/>
|
|
|
</el-row>
|
|
|
</el-col>
|
|
@@ -83,6 +84,18 @@
|
|
|
no-foot
|
|
|
maxHeight="300px"
|
|
|
>
|
|
|
+ <template #status-column-value="{ scope }">
|
|
|
+ <div class="m-auto" @click.capture.stop="onSwitch(scope.row)">
|
|
|
+ <a-switch
|
|
|
+ v-model:checked="scope.row.status"
|
|
|
+ checked-children="启用"
|
|
|
+ un-checked-children="停用"
|
|
|
+ checked-value="0"
|
|
|
+ un-checked-value="1"
|
|
|
+ size="small"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<template #caozuo-column-value="{ scope }">
|
|
|
<div class="__czr-table-operations">
|
|
|
<CzrButton type="table-del" @click="onDel(scope.row)" />
|
|
@@ -147,6 +160,7 @@ import {
|
|
|
tenantsEdit,
|
|
|
} from '@/api/modules/center/tenant'
|
|
|
import { accountGenerateFriendlyCode } from '@/api/modules/global/invite'
|
|
|
+import { pluginUpdateStatus } from '@/api/modules/model'
|
|
|
|
|
|
const router = useRouter()
|
|
|
const AppStore = useAppStore()
|
|
@@ -165,8 +179,8 @@ const state: any = reactive({
|
|
|
admins: {
|
|
|
head: [
|
|
|
{ value: 'loginId', label: '账号', show: true },
|
|
|
- { value: 'name', label: '用户名', show: true },
|
|
|
- { value: 'status', label: '状态', show: true },
|
|
|
+ { value: 'username', label: '用户名', show: true },
|
|
|
+ { value: 'status', label: '状态', show: true, popover: false },
|
|
|
{
|
|
|
value: 'caozuo',
|
|
|
label: '操作',
|
|
@@ -222,6 +236,9 @@ const initData = () => {
|
|
|
tenantsDetail(props.transfer.id)
|
|
|
.then(({ data }: any) => {
|
|
|
state.form = data
|
|
|
+ if (state.form.picture) {
|
|
|
+ state.file = [{ url: state.form.picture }]
|
|
|
+ }
|
|
|
})
|
|
|
.catch(() => {})
|
|
|
.finally(() => {
|
|
@@ -278,6 +295,7 @@ const onInvite = () => {
|
|
|
accountGenerateFriendlyCode({
|
|
|
userId: AppStore.userInfo?.id,
|
|
|
tenantId: state.form.id,
|
|
|
+ type: 0,
|
|
|
})
|
|
|
.then(({ data }: any) => {
|
|
|
const routerUrl = router.resolve({
|
|
@@ -299,7 +317,7 @@ const onCopy = (str) => {
|
|
|
const onDel = (row) => {
|
|
|
DialogStore.confirm({
|
|
|
title: '删除确认',
|
|
|
- content: `请确认是否删除${row.name}?`,
|
|
|
+ content: `请确认是否删除${row.username}?`,
|
|
|
onSubmit: () => {
|
|
|
accountDel(row.id)
|
|
|
.then(() => {
|
|
@@ -310,6 +328,34 @@ const onDel = (row) => {
|
|
|
},
|
|
|
})
|
|
|
}
|
|
|
+const onSwitch = (row) => {
|
|
|
+ if (row.status == 0) {
|
|
|
+ DialogStore.confirm({
|
|
|
+ title: '停用确认',
|
|
|
+ content: `请确认是否停用管理员账号${row.username}?`,
|
|
|
+ onSubmit: () => {
|
|
|
+ // pluginUpdateStatus({ ids: [row.id], status: '1' })
|
|
|
+ // .then(() => {
|
|
|
+ // ElMessage.success('停用成功!')
|
|
|
+ // })
|
|
|
+ // .catch(() => {})
|
|
|
+ // .finally(() => {
|
|
|
+ // row.status = '1'
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ onCancel: () => {},
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // pluginUpdateStatus({ ids: [row.id], status: 0 })
|
|
|
+ // .then(() => {
|
|
|
+ // ElMessage.success('启用成功!')
|
|
|
+ // })
|
|
|
+ // .catch(() => {})
|
|
|
+ // .finally(() => {
|
|
|
+ // row.status = '0'
|
|
|
+ // })
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped></style>
|