|
@@ -10,15 +10,9 @@
|
|
<template #pid>
|
|
<template #pid>
|
|
<el-option v-for="(i, index) in pidList" :key="index" :label="i.name" :value="i._id"></el-option>
|
|
<el-option v-for="(i, index) in pidList" :key="index" :label="i.name" :value="i._id"></el-option>
|
|
</template>
|
|
</template>
|
|
- <template #type>
|
|
|
|
- <el-option v-for="(i, index) in typeList" :key="index" :label="i.label" :value="i.value"></el-option>
|
|
|
|
- </template>
|
|
|
|
<template #code>
|
|
<template #code>
|
|
<el-option v-for="(i, index) in codeList" :key="index" :label="i.label" :value="i.value"></el-option>
|
|
<el-option v-for="(i, index) in codeList" :key="index" :label="i.label" :value="i.value"></el-option>
|
|
</template>
|
|
</template>
|
|
- <template #password>
|
|
|
|
- <el-input v-model="form.password" placeholder="请输入密码" :disabled="form._id ? true : false" show-password></el-input>
|
|
|
|
- </template>
|
|
|
|
<template #role>
|
|
<template #role>
|
|
<el-select v-model="form.role" multiple placeholder="请选择角色" style="width: 100%">
|
|
<el-select v-model="form.role" multiple placeholder="请选择角色" style="width: 100%">
|
|
<el-option v-for="i in roleList" :key="i._id" :label="i.name" :value="i._id"> </el-option>
|
|
<el-option v-for="i in roleList" :key="i._id" :label="i.name" :value="i._id"> </el-option>
|
|
@@ -50,20 +44,13 @@ let form: Ref<any> = ref({});
|
|
let roleList: Ref<any> = ref([]);
|
|
let roleList: Ref<any> = ref([]);
|
|
let pidList: Ref<any> = ref([]);
|
|
let pidList: Ref<any> = ref([]);
|
|
let codeList: Ref<any> = ref([]);
|
|
let codeList: Ref<any> = ref([]);
|
|
-let typeList: Ref<any> = ref([
|
|
|
|
- { label: '超级管理员', value: '0' },
|
|
|
|
- { label: '管理员', value: '1' },
|
|
|
|
- { label: '机构用户', value: '2' },
|
|
|
|
- { label: '业务用户', value: '3' }
|
|
|
|
-]);
|
|
|
|
|
|
|
|
// 表单
|
|
// 表单
|
|
let formFields: Ref<any[]> = ref([
|
|
let formFields: Ref<any[]> = ref([
|
|
{ label: '所属上级', model: 'pid', type: 'select' },
|
|
{ label: '所属上级', model: 'pid', type: 'select' },
|
|
- { label: '用户类型', model: 'type', type: 'select', options: { disabled: true } },
|
|
|
|
{ label: '邀请码', model: 'code', type: 'select' },
|
|
{ label: '邀请码', model: 'code', type: 'select' },
|
|
{ label: '账号', model: 'account' },
|
|
{ label: '账号', model: 'account' },
|
|
- { label: '密码', model: 'password', custom: true },
|
|
|
|
|
|
+ { label: '密码', model: 'password', type: 'password' },
|
|
{ label: '名称', model: 'name' },
|
|
{ label: '名称', model: 'name' },
|
|
{ label: '手机号', model: 'phone' },
|
|
{ label: '手机号', model: 'phone' },
|
|
{ label: '机构名称', model: 'dept_name' },
|
|
{ label: '机构名称', model: 'dept_name' },
|
|
@@ -71,8 +58,7 @@ let formFields: Ref<any[]> = ref([
|
|
]);
|
|
]);
|
|
const rules = reactive<FormRules>({
|
|
const rules = reactive<FormRules>({
|
|
name: [{ required: true, message: '名称', trigger: 'blur' }],
|
|
name: [{ required: true, message: '名称', trigger: 'blur' }],
|
|
- account: [{ required: true, message: '账号', trigger: 'blur' }],
|
|
|
|
- type: [{ required: true, message: '用户类型', trigger: 'blur' }]
|
|
|
|
|
|
+ account: [{ required: true, message: '账号', trigger: 'blur' }]
|
|
});
|
|
});
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
loading.value = true;
|
|
loading.value = true;
|
|
@@ -82,10 +68,9 @@ onMounted(async () => {
|
|
});
|
|
});
|
|
const search = async () => {
|
|
const search = async () => {
|
|
if (route.query.id) {
|
|
if (route.query.id) {
|
|
|
|
+ formFields.value = formFields.value.filter((i) => i.model != 'password');
|
|
let res: IQueryResult = await admin.fetch(route.query.id);
|
|
let res: IQueryResult = await admin.fetch(route.query.id);
|
|
- if (res.errcode == 0) {
|
|
|
|
- form.value = res.data as {};
|
|
|
|
- }
|
|
|
|
|
|
+ if (res.errcode == 0) form.value = res.data as {};
|
|
} else form.value.type = '1';
|
|
} else form.value.type = '1';
|
|
};
|
|
};
|
|
// 提交
|
|
// 提交
|