Commit 8784ce1d authored by 孙浩然's avatar 孙浩然

feat(doctor): 优化医生信息新增 / 修改功能

- 为 AddDoctor 组件添加 modalVisible 控制模态框显示
- 增加密码字段隐藏逻辑,编辑时隐藏密码输入框
- 优化医生信息编辑功能,支持权限码分割
- 调整取消按钮点击事件,统一使用关闭模态框方法
parent bddff9b2
......@@ -26,7 +26,7 @@
<ElRow v-else v-bind="rowProps || {}">
<template v-for="item in items">
<ElCol
v-if="isShowItem(item, model, formItems || items, searchExpand)"
v-if="isShowItem(item, model, formItems || items, searchExpand) && !item.isHide"
:key="item.key ?? item.prop"
v-bind="{
...(grid === true ? { span: 12 } : grid),
......
<template>
<ele-modal
v-if="modalVisible"
v-model="modalVisible"
:title="modalTitle"
width="600px"
position="center"
:close-on-click-modal="false"
@close="handleClose"
>
<ele-loading :loading="pageLoading">
<ele-card>
......@@ -19,7 +22,7 @@
</ele-card>
</ele-loading>
<template #footer>
<el-button type="primary" plain @click="handleCancel">取消</el-button>
<el-button type="primary" plain @click="handleClose">取消</el-button>
<el-button type="primary" @click="onSubmit">确定</el-button>
</template>
</ele-modal>
......@@ -50,13 +53,26 @@
const open = (type: 'add' | 'edit' = 'add', info?: addUserDto) => {
useType.value = type;
modalVisible.value = true;
const passwordItem = items.value.find(
(item) => item.prop === 'userPassword'
);
if (type === 'edit') {
curInfo.value = info;
Object.assign(form, info);
if ('jurisdictionCode' in info!) {
form.jurisdictionCode = (info.jurisdictionCode as string)!.split(',');
if (info.jurisdictionCode) {
form.jurisdictionCode = info.jurisdictionCode.split(',');
}
console.log(info, form, '表单数据');
// if ('jurisdictionCode' in info!) {
// form.jurisdictionCode = (info.jurisdictionCode as string)!.split(',');
// }
passwordItem.isHide = true;
} else {
passwordItem.isHide = false;
}
};
defineExpose({
......@@ -110,7 +126,13 @@
},
{ label: '科室名称', prop: 'deptName', type: 'input', required: true },
{ label: '科室编码', prop: 'deptCode', type: 'input', required: true },
{ label: '用户密码', prop: 'userPassword', type: 'input', required: true },
{
label: '用户密码',
prop: 'userPassword',
type: 'input',
required: true,
isHide: false
},
{ label: '微信id', prop: 'wxId', type: 'input', required: false },
{
label: '权限',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment