|
@@ -1,97 +1,39 @@
|
|
|
<template>
|
|
|
<div class="tenant">
|
|
|
- <byTable
|
|
|
- :source="sourceList.data"
|
|
|
- :pagination="sourceList.pagination"
|
|
|
- :config="config"
|
|
|
- :loading="loading"
|
|
|
- highlight-current-row
|
|
|
- :action-list="[
|
|
|
+ <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row :action-list="[
|
|
|
{
|
|
|
text: '添加用户',
|
|
|
action: () => openModal(),
|
|
|
},
|
|
|
- ]"
|
|
|
- @get-list="getList"
|
|
|
- >
|
|
|
+ ]" @get-list="getList">
|
|
|
</byTable>
|
|
|
|
|
|
- <el-dialog
|
|
|
- :title="modalType == 'add' ? '添加用户' : '编辑用户'"
|
|
|
- v-if="dialogVisible"
|
|
|
- v-model="dialogVisible"
|
|
|
- width="600"
|
|
|
- v-loading="loadingDialog"
|
|
|
- >
|
|
|
- <byForm
|
|
|
- :formConfig="formConfig"
|
|
|
- :formOption="formOption"
|
|
|
- v-model="formData.data"
|
|
|
- :rules="rules"
|
|
|
- ref="submit"
|
|
|
- >
|
|
|
+ <el-dialog :title="modalType == 'add' ? '添加用户' : '编辑用户'" v-if="dialogVisible" v-model="dialogVisible" width="600" v-loading="loadingDialog">
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
|
|
|
<template #deptId>
|
|
|
<div style="width: 100%">
|
|
|
- <el-tree-select
|
|
|
- v-model="formData.data.deptId"
|
|
|
- :data="deptList.data"
|
|
|
- check-strictly
|
|
|
- :render-after-expand="false"
|
|
|
- node-key="deptId"
|
|
|
- :props="defaultProps"
|
|
|
- />
|
|
|
+ <el-tree-select v-model="formData.data.deptId" :data="deptList.data" check-strictly :render-after-expand="false" node-key="deptId"
|
|
|
+ :props="defaultProps" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #account>
|
|
|
- <el-input
|
|
|
- style="width: 150px; margin-right: 10px"
|
|
|
- v-model="formData.data.userName"
|
|
|
- @change="changeUserName"
|
|
|
- placeholder="请输入用户名"
|
|
|
- ></el-input>
|
|
|
- <el-input
|
|
|
- style="width: 150px; margin-right: 10px"
|
|
|
- v-model="formData.data.password"
|
|
|
- @change="changePassword"
|
|
|
- placeholder="密码"
|
|
|
- ></el-input>
|
|
|
- <span style="color: #409eff; cursor: pointer" @click="newPassword"
|
|
|
- >随机生成</span
|
|
|
- >
|
|
|
+ <el-input style="width: 150px; margin-right: 10px" v-model="formData.data.userName" @change="changeUserName"
|
|
|
+ placeholder="请输入用户名"></el-input>
|
|
|
+ <el-input style="width: 150px; margin-right: 10px" v-model="formData.data.password" @change="changePassword" placeholder="密码"></el-input>
|
|
|
+ <span style="color: #409eff; cursor: pointer" @click="newPassword">随机生成</span>
|
|
|
</template>
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitForm()" size="large"
|
|
|
- >确 定</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog
|
|
|
- title="修改密码"
|
|
|
- v-if="roomDialogVisible"
|
|
|
- v-model="roomDialogVisible"
|
|
|
- width="300"
|
|
|
- v-loading="loading"
|
|
|
- >
|
|
|
+ <el-dialog title="修改密码" v-if="roomDialogVisible" v-model="roomDialogVisible" width="300" v-loading="loading">
|
|
|
<template #footer>
|
|
|
- <el-input
|
|
|
- v-model="password"
|
|
|
- placeholder="请输入新密码"
|
|
|
- @change="changePassword2"
|
|
|
- style="margin-bottom: 20px"
|
|
|
- />
|
|
|
- <el-button @click="roomDialogVisible = false" size="large"
|
|
|
- >取 消</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="submitPassword(password)"
|
|
|
- size="large"
|
|
|
- :loading="submitLoading"
|
|
|
- >确 定</el-button
|
|
|
- >
|
|
|
+ <el-input v-model="password" placeholder="请输入新密码" @change="changePassword2" style="margin-bottom: 20px" />
|
|
|
+ <el-button @click="roomDialogVisible = false" size="large">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitPassword(password)" size="large" :loading="submitLoading">确 定</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -111,6 +53,7 @@ const defaultProps = {
|
|
|
label: "deptName",
|
|
|
};
|
|
|
const deptList = ref([]);
|
|
|
+const roleData = ref([]);
|
|
|
const sourceList = ref({
|
|
|
data: [],
|
|
|
pagination: {
|
|
@@ -161,6 +104,15 @@ const config = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
+ label: "账号状态",
|
|
|
+ prop: "status",
|
|
|
+ },
|
|
|
+ render(status) {
|
|
|
+ return status == 1 ? "停用" : "启用";
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
label: "手机号",
|
|
|
prop: "phonenumber",
|
|
|
},
|
|
@@ -337,10 +289,26 @@ const formConfig = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
+ label: "账号状态",
|
|
|
+ prop: "status",
|
|
|
+ multiple: false,
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ label: "停用",
|
|
|
+ value: "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "启用",
|
|
|
+ value: "0",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
label: "角色",
|
|
|
prop: "roleIds",
|
|
|
multiple: true,
|
|
|
- data: [],
|
|
|
+ data: roleData.value,
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
@@ -366,6 +334,7 @@ const rules = ref({
|
|
|
userName: [{ required: true, message: "请输入用户名", trigger: "blur" }],
|
|
|
roleIds: [{ required: true, message: "请选择角色", trigger: "change" }],
|
|
|
phonenumber: [{ required: true, message: "请输入手机号", trigger: "blur" }],
|
|
|
+ status: [{ required: true, message: "请选择账号状态", trigger: "change" }],
|
|
|
});
|
|
|
const getUserList = () => {
|
|
|
proxy
|
|
@@ -373,7 +342,7 @@ const getUserList = () => {
|
|
|
`/tenantRole/list?pageNum=1&pageSize=10000&tenantId=${sourceList.value.pagination.tenantId}`
|
|
|
)
|
|
|
.then((message) => {
|
|
|
- formConfig.value[5].data = message.rows.map((item) => {
|
|
|
+ roleData.value = message.rows.map((item) => {
|
|
|
return {
|
|
|
...item,
|
|
|
id: item.roleId,
|