提交代码
This commit is contained in:
parent
0bc67c300f
commit
c550e8bb49
|
@ -119,3 +119,14 @@ export const updatePasswordByOldPassword = (account,oldPassword,newPassword,tena
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
//根据用户名与租户Id验证密码是否正确
|
||||
export const getUserById = (id) => {
|
||||
return request({
|
||||
url: '/api/' + moduleName + '/ui/administrator/getUserById',
|
||||
method: 'get',
|
||||
params: {
|
||||
id,
|
||||
}
|
||||
});
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
<template>
|
||||
<el-dialog title="User Info" v-model="state.isShowDialog" width="35%" center>
|
||||
<el-form :model="state.ruleForm" size="default" label-width="90px" :rules="rules" ref="adminAddFormRef">
|
||||
<el-form-item label="name" >
|
||||
<el-input v-model="state.ruleForm.name" clearable disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="email" >
|
||||
<el-input v-model="state.ruleForm.email" clearable disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="account" >
|
||||
<el-input v-model="state.ruleForm.account" clearable disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="occupation" >
|
||||
<el-input v-model="state.ruleForm.occupation" clearable disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="country" >
|
||||
<el-input v-model="state.ruleForm.country" clearable disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="phone" >
|
||||
<el-input v-model="state.ruleForm.phone" clearable disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="organization" >
|
||||
<el-input v-model="state.ruleForm.organization" clearable disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="role" >
|
||||
<el-tag type="info" v-if="state.ruleForm.roleId == '1123598816738675203'">Admin</el-tag>
|
||||
<el-tag type="info" v-if="state.ruleForm.roleId == '1793193529859244033'">Chief admin</el-tag>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {reactive, ref} from "vue";
|
||||
import {getUserById, updateAdmin} from '/@/api/response/administrator.js';
|
||||
import {ElMessage} from "element-plus";
|
||||
import { getList } from '/@/api/system/role';
|
||||
const adminAddFormRef = ref();
|
||||
const emit = defineEmits(['callback']);
|
||||
const state = reactive({
|
||||
isShowDialog: false,
|
||||
isLoading:false,
|
||||
ruleForm: {
|
||||
},
|
||||
})
|
||||
//重置表单
|
||||
const resetField = () => {
|
||||
adminAddFormRef.value.resetFields();
|
||||
}
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (row) => {
|
||||
state.isShowDialog = true;
|
||||
getUserById(row.id).then(res => {
|
||||
state.ruleForm = res
|
||||
});
|
||||
};
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
state.isShowDialog = false;
|
||||
//重置表格数据
|
||||
state.ruleForm.tableData = [];
|
||||
resetField();
|
||||
};
|
||||
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -7,6 +7,12 @@
|
|||
<!-- <el-table-column type="selection" width="60" @select="selectRow" />-->
|
||||
<el-table-column prop="userName" label="Name" show-overflow-tooltip></el-table-column>
|
||||
<!-- <el-table-column prop="userEmail" label="E-mail" show-overflow-tooltip></el-table-column>-->
|
||||
<el-table-column fixed="right" label="particulars" min-width="120">
|
||||
<template #default="scope">
|
||||
<el-tag type="info" ref="selectUserDetails" @click="getSelectUserDetails(scope.row)">
|
||||
<el-icon><ele-Tickets /></el-icon></el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userStatus" label="role" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-tag type="info" v-if="scope.row.userStatus == 1">Admin</el-tag>
|
||||
|
@ -85,7 +91,12 @@
|
|||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%" @selection-change="selectionChange">
|
||||
<!-- <el-table-column type="selection" width="60" @select="selectRow" />-->
|
||||
<el-table-column prop="name" label="Name" show-overflow-tooltip></el-table-column>
|
||||
<!-- <el-table-column prop="email" label="E-mail" show-overflow-tooltip></el-table-column>-->
|
||||
<el-table-column fixed="right" label="particulars" min-width="120">
|
||||
<template #default="scope">
|
||||
<el-tag type="info" ref="selectUserDetails" @click="getSelectUserDetails(scope.row)">
|
||||
<el-icon><ele-Tickets /></el-icon></el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userStatus" label="role" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-tag type="info" v-if="scope.row.roleId == '1123598816738675203'">Admin</el-tag>
|
||||
|
@ -129,6 +140,7 @@
|
|||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<SelectUserDetails ref="selectUserDetailsRef" @callback="getTableData"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -139,10 +151,12 @@ import { getAdminPage } from '/@/api/response/administrator.js';
|
|||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { useThemeConfig } from '/@/stores/themeConfig';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import SelectUserDetails from './selectUserDetails.vue';
|
||||
|
||||
const storesThemeConfig = useThemeConfig();
|
||||
const { website } = storeToRefs(storesThemeConfig);
|
||||
const formRef = ref();
|
||||
const selectUserDetailsRef = ref();
|
||||
const dataIndex=[];
|
||||
let chiefCount=0
|
||||
let adminCount=0
|
||||
|
@ -190,6 +204,10 @@ const state = reactive({
|
|||
selectType: []
|
||||
});
|
||||
|
||||
const getSelectUserDetails = (row) => {
|
||||
selectUserDetailsRef.value.openDialog(row);
|
||||
}
|
||||
|
||||
const sendToLeft = (index,row) => {
|
||||
if (row.roleId == '1793193529859244033') {
|
||||
chiefCount=chiefCount-1
|
||||
|
@ -453,6 +471,7 @@ const getTableDataNew = () => {
|
|||
state.tableDataNew.data = da.records;
|
||||
state.tableDataNew.data.forEach((item) => {
|
||||
item.userId = item.adminId;
|
||||
item.id = item.adminId;
|
||||
item.name = item.userName;
|
||||
item.email = item.userEmail;
|
||||
item.roleId = item.userStatus==0?'1793193529859244033':'1123598816738675203';
|
||||
|
|
Loading…
Reference in New Issue