|
@@ -14,6 +14,11 @@
|
|
|
{{ scope.row.userType === '1' ? '管理员': '普通用户' }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="帐号状态" align="center" prop="status">
|
|
|
+ <template #default="scope">
|
|
|
+ <dict-tag :type="DICT_TYPE.MENDUNER_STATUS" :value="scope.row.status" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="最后登录IP" align="center" prop="loginIp" />
|
|
|
<el-table-column
|
|
|
label="最后登录时间"
|
|
@@ -29,6 +34,12 @@
|
|
|
:formatter="dateFormatter"
|
|
|
width="180px"
|
|
|
/>
|
|
|
+ <el-table-column label="操作" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button v-if="scope.row.status === '0'" link type="danger" @click="handleActions(scope.row.id, 'disabled')">禁用</el-button>
|
|
|
+ <el-button v-if="scope.row.status === '1'" link type="success" @click="handleActions(scope.row.id, 'enable')">启用</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<Pagination
|
|
@@ -44,11 +55,13 @@ defineOptions({ name: 'EnterpriseUserList'})
|
|
|
import { EnterpriseApi } from '@/api/menduner/system/enterprise/message'
|
|
|
import { DICT_TYPE } from '@/utils/dict'
|
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
|
+import { EnterpriseUserBindApi } from '@/api/menduner/system/enterprise/userBind'
|
|
|
|
|
|
const props = defineProps({
|
|
|
id: String
|
|
|
})
|
|
|
|
|
|
+const message = useMessage() // 消息弹窗
|
|
|
const loading = ref(false)
|
|
|
const tableData = ref([])
|
|
|
const total = ref(0)
|
|
@@ -69,4 +82,15 @@ const getList = async () => {
|
|
|
}
|
|
|
}
|
|
|
getList()
|
|
|
+
|
|
|
+// 禁用、启用账户
|
|
|
+const handleActions = async (id, type) => {
|
|
|
+ try {
|
|
|
+ await message.confirm(type === 'disabled' ? '确定要禁用该账户吗?' : '确定要启用该账户吗?')
|
|
|
+ type === 'disabled' ? await EnterpriseUserBindApi.disabledEnterpriseAccount(id) : await EnterpriseUserBindApi.enableEnterpriseAccount([id])
|
|
|
+ message.success('操作成功')
|
|
|
+ // 刷新列表
|
|
|
+ await getList()
|
|
|
+ } catch {}
|
|
|
+}
|
|
|
</script>
|