update
1.更新im 2.修改最近提的问题
This commit is contained in:
@@ -1,303 +0,0 @@
|
||||
<template>
|
||||
<div :class="prefixCls" class="login-background-img">
|
||||
<!-- <AppLocalePicker :showText="false" class="absolute top-4 right-4 enter-x xl:text-gray-600" />-->
|
||||
<!-- <AppDarkModeToggle class="absolute top-3 right-7 enter-x" />-->
|
||||
<div v-show="type === 'login'">
|
||||
<div class="aui-content">
|
||||
<div class="aui-top">
|
||||
<div class="aui-title">{{ t('sys.login.loginTitle') }}</div>
|
||||
<div class="aui-title-image"></div>
|
||||
</div>
|
||||
<div class="aui-container">
|
||||
<div class="aui-form">
|
||||
<div class="aui-formBox">
|
||||
<div class="aui-formWell">
|
||||
<div class="form-title">{{ t('sys.login.formTitle') }}</div>
|
||||
<div class="aui-form-box" style="height: 180px">
|
||||
<a-form ref="loginRef" :model="formData" @keyup.enter.native="loginHandleClick">
|
||||
<div class="aui-account">
|
||||
<div class="aui-inputClear">
|
||||
<i class="icon icon-code"></i>
|
||||
<a-form-item>
|
||||
<a-input
|
||||
v-model:value="formData.username"
|
||||
:placeholder="t('sys.login.userName')"
|
||||
class="fix-auto-fill"
|
||||
/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="aui-inputClear">
|
||||
<i class="icon icon-password"></i>
|
||||
<a-form-item>
|
||||
<a-input
|
||||
v-model:value="formData.password"
|
||||
:placeholder="t('sys.login.password')"
|
||||
class="fix-auto-fill"
|
||||
type="password"
|
||||
/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="aui-inputClear">
|
||||
<i class="icon icon-code"></i>
|
||||
<a-form-item>
|
||||
<a-input
|
||||
v-model:value="formData.inputCode"
|
||||
:placeholder="t('sys.login.inputCode')"
|
||||
class="fix-auto-fill"
|
||||
type="text"
|
||||
/>
|
||||
</a-form-item>
|
||||
<div class="aui-code">
|
||||
<img
|
||||
v-if="randCodeData.requestCodeSuccess"
|
||||
:src="randCodeData.randCodeImage"
|
||||
@click="handleChangeCheckCode"
|
||||
/>
|
||||
<img
|
||||
v-else
|
||||
:src="codeImg"
|
||||
style="margin-top: 2px; max-width: initial"
|
||||
@click="handleChangeCheckCode"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="aui-flex remember">
|
||||
<div class="aui-flex-box">
|
||||
<div class="aui-choice">
|
||||
<a-input v-model:value="rememberMe" class="fix-auto-fill" type="checkbox" />
|
||||
<span class="aui-check">{{ t('sys.login.rememberMe') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-form>
|
||||
</div>
|
||||
<div class="aui-formButton">
|
||||
<div class="aui-flex">
|
||||
<a-button
|
||||
:loading="loginLoading"
|
||||
class="aui-link-login aui-flex-box"
|
||||
style="background: #53b173; color: #ffffff"
|
||||
@click="loginHandleClick"
|
||||
>
|
||||
{{ t('sys.login.loginButton') }}
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" name="login-mini" setup>
|
||||
import { getCodeInfo } from '/@/api/sys/user';
|
||||
import { onMounted, reactive, ref, toRaw, watch } from 'vue';
|
||||
import codeImg from '/@/assets/images/checkcode.png';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { useDesign } from '/@/hooks/web/useDesign';
|
||||
import { encipher } from '/@/utils/jsencrypt';
|
||||
|
||||
const { prefixCls } = useDesign('mini-login');
|
||||
const { notification, createMessage } = useMessage();
|
||||
const userStore = useUserStore();
|
||||
const { t } = useI18n();
|
||||
const randCodeData = reactive<any>({
|
||||
randCodeImage: '',
|
||||
requestCodeSuccess: false,
|
||||
checkKey: null,
|
||||
});
|
||||
const rememberMe = ref<string>('0');
|
||||
const type = ref<string>('login');
|
||||
//账号登录表单字段
|
||||
const formData = reactive<any>({
|
||||
inputCode: '',
|
||||
username: '',
|
||||
password: '',
|
||||
});
|
||||
const loginRef = ref();
|
||||
const loginLoading = ref<boolean>(false);
|
||||
defineProps({
|
||||
sessionTimeout: {
|
||||
type: Boolean,
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
*/
|
||||
function handleChangeCheckCode() {
|
||||
formData.inputCode = '';
|
||||
|
||||
randCodeData.checkKey = 1629428467008;
|
||||
getCodeInfo(randCodeData.checkKey).then((res) => {
|
||||
randCodeData.randCodeImage = res;
|
||||
randCodeData.requestCodeSuccess = true;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 账号或者手机登录
|
||||
*/
|
||||
async function loginHandleClick() {
|
||||
accountLogin();
|
||||
}
|
||||
|
||||
watch(
|
||||
() => formData.password,
|
||||
() => {
|
||||
formData.password = formData.password.replace(/[\u4e00-\u9fa5]/g, '');
|
||||
}
|
||||
);
|
||||
async function accountLogin() {
|
||||
if (!formData.username) {
|
||||
createMessage.warn(t('sys.login.accountPlaceholder'));
|
||||
return;
|
||||
}
|
||||
if (!formData.password) {
|
||||
createMessage.warn(t('sys.login.passwordPlaceholder'));
|
||||
return;
|
||||
}
|
||||
if (!formData.inputCode) {
|
||||
createMessage.warn(t('sys.login.inputCodePlaceholder'));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
loginLoading.value = true;
|
||||
const { userInfo } = await userStore.login(
|
||||
toRaw({
|
||||
password: encipher(formData.password) as string,
|
||||
// password: formData.password,
|
||||
username: formData.username,
|
||||
captcha: formData.inputCode,
|
||||
checkKey: randCodeData.checkKey,
|
||||
mode: 'none', //不要默认的错误提示
|
||||
})
|
||||
);
|
||||
if (userInfo) {
|
||||
notification.success({
|
||||
message: t('sys.login.loginSuccessTitle'),
|
||||
description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.realname}`,
|
||||
duration: 3,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
notification.error({
|
||||
message: t('sys.api.errorTip'),
|
||||
description: error.message || t('sys.login.networkExceptionMsg'),
|
||||
duration: 3,
|
||||
});
|
||||
handleChangeCheckCode();
|
||||
} finally {
|
||||
loginLoading.value = false;
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
//加载验证码
|
||||
handleChangeCheckCode();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import '/@/assets/loginmini/style/home1.less';
|
||||
@import '/@/assets/loginmini/style/base.less';
|
||||
</style>
|
||||
|
||||
<style lang="less">
|
||||
@prefix-cls: ~'@{namespace}-mini-login';
|
||||
@dark-bg: #293146;
|
||||
|
||||
html[data-theme='dark'] {
|
||||
.@{prefix-cls} {
|
||||
background-color: @dark-bg !important;
|
||||
background-image: none;
|
||||
|
||||
&::before {
|
||||
background-image: url(/@/assets/svg/login-bg-dark.svg);
|
||||
}
|
||||
|
||||
.aui-inputClear {
|
||||
background-color: #232a3b !important;
|
||||
}
|
||||
|
||||
.ant-input,
|
||||
.ant-input-password {
|
||||
background-color: #232a3b !important;
|
||||
}
|
||||
|
||||
.ant-btn:not(.ant-btn-link):not(.ant-btn-primary) {
|
||||
border: 1px solid #4a5569 !important;
|
||||
}
|
||||
|
||||
&-form {
|
||||
background: @dark-bg !important;
|
||||
}
|
||||
|
||||
.app-iconify {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.aui-inputClear input,
|
||||
.aui-input-line input,
|
||||
.aui-choice {
|
||||
color: #c9d1d9 !important;
|
||||
}
|
||||
|
||||
.aui-formBox {
|
||||
background-color: @dark-bg !important;
|
||||
}
|
||||
|
||||
.aui-third-text span {
|
||||
background-color: @dark-bg !important;
|
||||
}
|
||||
|
||||
.aui-form-nav .aui-flex-box {
|
||||
color: #c9d1d9 !important;
|
||||
}
|
||||
|
||||
.aui-formButton .aui-linek-code {
|
||||
background: @dark-bg !important;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.aui-code-line {
|
||||
border-left: none !important;
|
||||
}
|
||||
|
||||
.ant-checkbox-inner,
|
||||
.aui-success h3 {
|
||||
border-color: #c9d1d9;
|
||||
}
|
||||
}
|
||||
|
||||
input.fix-auto-fill,
|
||||
.fix-auto-fill input {
|
||||
-webkit-text-fill-color: #c9d1d9 !important;
|
||||
box-shadow: inherit !important;
|
||||
}
|
||||
|
||||
&-sign-in-way {
|
||||
.anticon {
|
||||
font-size: 22px !important;
|
||||
color: #888 !important;
|
||||
cursor: pointer !important;
|
||||
|
||||
&:hover {
|
||||
color: @primary-color !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ant-divider-inner-text {
|
||||
font-size: 12px !important;
|
||||
color: @text-color-secondary !important;
|
||||
}
|
||||
|
||||
.aui-third-login a {
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -17,9 +17,9 @@
|
||||
import { ref, toRaw, unref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicTable } from '/@/components/Table';
|
||||
import { checkUserFormSchema1, userColumns1 } from '../role.data';
|
||||
import { checkUserFormSchema, userColumns } from '../role.data';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { listUser } from '/@/views/system/role/role.api';
|
||||
import { list } from '../../user/user.api';
|
||||
// 声明Emits
|
||||
const emit = defineEmits(['select', 'register']);
|
||||
const props = defineProps({
|
||||
@@ -30,12 +30,12 @@
|
||||
//注册table数据
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
api: listUser,
|
||||
rowKey: 'userId',
|
||||
columns: userColumns1,
|
||||
api: list,
|
||||
rowKey: 'id',
|
||||
columns: userColumns,
|
||||
formConfig: {
|
||||
labelWidth: 60,
|
||||
schemas: checkUserFormSchema1,
|
||||
schemas: checkUserFormSchema,
|
||||
baseRowStyle: { maxHeight: '20px' },
|
||||
autoSubmitOnEnter: true,
|
||||
baseColProps: {
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
<template>
|
||||
<div style="min-height: 400px">
|
||||
<BasicForm @register="registerForm" />
|
||||
<div v-if="!formDisabled" style="width: 100%; text-align: center">
|
||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { BasicForm, useForm } from '/@/components/Form';
|
||||
import { computed, defineComponent } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import { getBpmFormSchema } from '../healthOperatorEx.data';
|
||||
import { queryByIdUrl, saveOrUpdate } from '../healthOperatorEx.api';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'HealthOperatorExForm',
|
||||
components: {
|
||||
BasicForm,
|
||||
},
|
||||
props: {
|
||||
formData: propTypes.object.def({}),
|
||||
formBpm: propTypes.bool.def(true),
|
||||
},
|
||||
setup(props) {
|
||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: getBpmFormSchema(props.formData),
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
const formDisabled = computed(() => {
|
||||
if (props.formData.disabled === false) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
let formData = {};
|
||||
async function initFormData() {
|
||||
let params = { id: props.formData.dataId };
|
||||
const data = await defHttp.get({ url: queryByIdUrl, params });
|
||||
formData = { ...data };
|
||||
//设置表单的值
|
||||
await setFieldsValue(formData);
|
||||
//默认是禁用
|
||||
await setProps({ disabled: formDisabled.value });
|
||||
}
|
||||
|
||||
async function submitForm() {
|
||||
let data = getFieldsValue();
|
||||
let params = Object.assign({}, formData, data);
|
||||
await saveOrUpdate(params, true);
|
||||
}
|
||||
|
||||
initFormData();
|
||||
|
||||
return {
|
||||
registerForm,
|
||||
formDisabled,
|
||||
submitForm,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@@ -1,96 +0,0 @@
|
||||
<template>
|
||||
<BasicDrawer
|
||||
:title="title"
|
||||
width="70%"
|
||||
:showFooter="showFooter"
|
||||
destroyOnClose
|
||||
v-bind="$attrs"
|
||||
@ok="handleSubmit"
|
||||
@register="registerDrawer"
|
||||
:maskClosable="false"
|
||||
>
|
||||
<div style="height: 60vh">
|
||||
<BasicForm @register="registerForm" />
|
||||
</div>
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, unref } from 'vue';
|
||||
import { BasicForm, useForm } from '/@/components/Form';
|
||||
import { formSchema } from '../healthOperatorEx.data';
|
||||
import { saveOrUpdate } from '../healthOperatorEx.api';
|
||||
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
|
||||
import { useDrawerAdaptiveWidth } from '/@/hooks/jeecg/useAdaptiveWidth';
|
||||
const { adaptiveWidth } = useDrawerAdaptiveWidth();
|
||||
// Emits声明
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref<boolean>(true);
|
||||
const showFooter = ref<boolean>(true);
|
||||
//设置标题
|
||||
const title = ref(String);
|
||||
//表单配置
|
||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, clearValidate, updateSchema }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
//表单赋值
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
setDrawerProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
showFooter.value = data.showFooter;
|
||||
title.value = data.type;
|
||||
if (unref(isUpdate)) {
|
||||
//表单赋值
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
await updateSchema([
|
||||
{
|
||||
field: 'password',
|
||||
ifShow: false,
|
||||
},
|
||||
]);
|
||||
await clearValidate();
|
||||
} else {
|
||||
await updateSchema([
|
||||
{
|
||||
field: 'password',
|
||||
ifShow: true,
|
||||
},
|
||||
]);
|
||||
}
|
||||
// 隐藏底部时禁用整个表单
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
//表单提交事件
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
let values = await validate();
|
||||
setDrawerProps({ confirmLoading: true });
|
||||
//提交表单
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
//关闭弹窗
|
||||
closeDrawer();
|
||||
//刷新列表
|
||||
emit('success');
|
||||
} finally {
|
||||
setDrawerProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
/** 时间和数字输入框样式 */
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.ant-calendar-picker) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -1,140 +0,0 @@
|
||||
import { defHttp } from "/@/utils/http/axios";
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
import { dealPassword } from "/@/views/system/user/user.data";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/sys/healthUserOperatorEx/operatorList',
|
||||
save = '/sys/healthUserOperatorEx/addOpertor',
|
||||
edit = '/sys/healthUserOperatorEx/editOpertor',
|
||||
deleteOne = '/sys/healthUserOperatorEx/delete',
|
||||
deleteBatch = '/sys/healthUserOperatorEx/deleteBatch',
|
||||
importExcel = '/sys/healthUserOperatorEx/importExcel',
|
||||
exportXls = '/sys/healthUserOperatorEx/exportXls',
|
||||
queryById = '/sys/healthUserOperatorEx/queryById',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
|
||||
/**
|
||||
* 编辑页面回显
|
||||
*/
|
||||
export const queryByIdUrl = Api.queryById;
|
||||
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 请求编辑数据
|
||||
*/
|
||||
export const resEditData = async (params) => {
|
||||
return await defHttp.get({ url: Api.queryById, params });
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
*/
|
||||
export const deleteOne = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp
|
||||
.delete(
|
||||
{
|
||||
url: Api.deleteBatch,
|
||||
data: params,
|
||||
},
|
||||
{ joinParamsToUrl: true }
|
||||
)
|
||||
.then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
let passwordObj = {};
|
||||
if (!isUpdate.value) {
|
||||
passwordObj = {
|
||||
password: dealPassword(params?.password),
|
||||
};
|
||||
}
|
||||
const data = {
|
||||
healthUserOperatorEx: {
|
||||
id: params?.id,
|
||||
userId: params?.userId,
|
||||
nativePlace: params?.nativePlace,
|
||||
nation: params?.nation,
|
||||
doctorTitle: params?.doctorTitle,
|
||||
goodAt: params?.goodAt,
|
||||
goodAtSymptom: params?.goodAtSymptom,
|
||||
goodAtSickness: params?.goodAtSickness,
|
||||
experience: params?.experience,
|
||||
cardNo: params?.cardNo,
|
||||
healthStatus: params?.healthStatus,
|
||||
college: params?.college,
|
||||
graduateDate: params?.graduateDate,
|
||||
education: params?.education,
|
||||
awardsPapers: params?.awardsPapers,
|
||||
resume: params?.resume,
|
||||
reason: params?.reason,
|
||||
onDutyTime: params?.onDutyTime,
|
||||
createTime: params?.createTime,
|
||||
phone: params?.phone,
|
||||
},
|
||||
sysUserModel: {
|
||||
username: params?.userName,
|
||||
...passwordObj,
|
||||
realname: params?.realname,
|
||||
birthday: params?.birthday,
|
||||
id: params?.id,
|
||||
sex: params?.sex,
|
||||
phone: params?.phone,
|
||||
avatar: params?.avatar,
|
||||
},
|
||||
},
|
||||
url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params: data });
|
||||
};
|
||||
@@ -1,389 +0,0 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { checkPassword } from '/@/hooks/checkPassword/checkPassword';
|
||||
import { isShowIdCard } from '/@/utils/getEnv';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '用户账号',
|
||||
align: 'center',
|
||||
dataIndex: 'userName',
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
align: 'center',
|
||||
dataIndex: 'realName',
|
||||
},
|
||||
// {
|
||||
// title: '籍贯',
|
||||
// align: 'center',
|
||||
// dataIndex: 'nativePlace',
|
||||
// },
|
||||
// {
|
||||
// title: '民族',
|
||||
// align: 'center',
|
||||
// dataIndex: 'nation',
|
||||
// customRender: ({ text }) => {
|
||||
// return render.renderDict(text, 'nation') || '';
|
||||
// },
|
||||
// },
|
||||
{
|
||||
title: '职称',
|
||||
align: 'center',
|
||||
dataIndex: 'doctorTitle',
|
||||
customRender: ({ text }) => {
|
||||
return render.renderDict(text, 'z_doct_lev');
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: '擅长',
|
||||
// align: 'center',
|
||||
// dataIndex: 'goodAt',
|
||||
// },
|
||||
// {
|
||||
// title: '执业经历',
|
||||
// align: 'center',
|
||||
// dataIndex: 'experience',
|
||||
// },
|
||||
// {
|
||||
// title: '擅长症状',
|
||||
// align: 'center',
|
||||
// dataIndex: 'goodAtSymptom',
|
||||
// },
|
||||
// {
|
||||
// title: '擅长疾病',
|
||||
// align: 'center',
|
||||
// dataIndex: 'goodAtSickness',
|
||||
// },
|
||||
{
|
||||
title: '注册时间',
|
||||
align: 'center',
|
||||
dataIndex: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '身份证号',
|
||||
align: 'center',
|
||||
dataIndex: 'cardNo',
|
||||
width: 160,
|
||||
ifShow: isShowIdCard(),
|
||||
},
|
||||
{
|
||||
title: '健康状况',
|
||||
align: 'center',
|
||||
dataIndex: 'healthStatus',
|
||||
customRender: ({ text }) => (text && render.renderDict(text, 'jk_status')) || '',
|
||||
},
|
||||
{
|
||||
title: '毕业院校',
|
||||
align: 'center',
|
||||
dataIndex: 'college',
|
||||
},
|
||||
{
|
||||
title: '毕业时间',
|
||||
align: 'center',
|
||||
dataIndex: 'graduateDate',
|
||||
customRender: ({ text }) => {
|
||||
return !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '学历',
|
||||
align: 'center',
|
||||
dataIndex: 'education',
|
||||
customRender: ({ text }) => (text && render.renderDict(text, 'emp_education')) || '',
|
||||
},
|
||||
// {
|
||||
// title: '获奖及论文发表',
|
||||
// align: 'center',
|
||||
// dataIndex: 'awardsPapers',
|
||||
// },
|
||||
// {
|
||||
// title: '工作经历',
|
||||
// align: 'center',
|
||||
// dataIndex: 'resume',
|
||||
// },
|
||||
// {
|
||||
// title: '入选理由',
|
||||
// align: 'center',
|
||||
// dataIndex: 'reason',
|
||||
// },
|
||||
{
|
||||
title: '值班时间',
|
||||
align: 'center',
|
||||
dataIndex: 'onDutyTime',
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'realName',
|
||||
label: '姓名',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
field: 'userId',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
label: '用户账号',
|
||||
field: 'userName',
|
||||
component: 'Input',
|
||||
componentProps: ({ formModel }) => {
|
||||
return {
|
||||
autocomplete: 'off',
|
||||
onInput: (event) => {
|
||||
const target = event.target;
|
||||
formModel.username = target.value.replace(/[^\w]/g, '');
|
||||
},
|
||||
};
|
||||
},
|
||||
required: true,
|
||||
rules: [{ required: true, message: '请输入用户账号' }],
|
||||
},
|
||||
{
|
||||
label: '密码',
|
||||
field: 'password',
|
||||
component: 'StrengthMeter',
|
||||
componentProps: {
|
||||
autocomplete: 'new-password',
|
||||
readOnly: true,
|
||||
onfocus: (field) => {
|
||||
field.target.readOnly = false;
|
||||
},
|
||||
},
|
||||
dynamicRules: () => {
|
||||
return [
|
||||
{
|
||||
required: true,
|
||||
validator: (_, value) => {
|
||||
let { message } = checkPassword(value);
|
||||
if (message === 'ok') {
|
||||
return Promise.resolve();
|
||||
} else {
|
||||
return Promise.reject(message);
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
},
|
||||
];
|
||||
},
|
||||
show: ({ values }) => {
|
||||
return !values.id;
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '姓名',
|
||||
field: 'realname',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
field: 'sex',
|
||||
component: 'JDictSelectTag',
|
||||
label: '性别',
|
||||
componentProps: {
|
||||
dictCode: 'sex2',
|
||||
type: 'radio',
|
||||
},
|
||||
rules: [{ required: true, message: '请选择性别' }],
|
||||
},
|
||||
{
|
||||
label: '头像',
|
||||
field: 'avatar',
|
||||
component: 'JImageUpload',
|
||||
componentProps: {
|
||||
maxCount: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
field: 'phone',
|
||||
component: 'Input',
|
||||
rules: [{ required: true, pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误' }],
|
||||
},
|
||||
// {
|
||||
// label: '人员类型',
|
||||
// field: 'userType',
|
||||
// component: 'JDictSelectTag',
|
||||
// componentProps: {
|
||||
// dictCode: 'p_type',
|
||||
// },
|
||||
// },
|
||||
{
|
||||
label: '身份证号',
|
||||
field: 'cardNo',
|
||||
component: 'Input',
|
||||
rules: [
|
||||
{ required: true, pattern: /^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|[xX])$/, message: '身份证号码格式有误' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '籍贯',
|
||||
field: 'nativePlace',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '民族',
|
||||
field: 'nation',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'nation',
|
||||
showSearch: true,
|
||||
filterOption: (input: string, option: any): boolean => {
|
||||
const str: string = input.toLowerCase();
|
||||
return option.label.toLowerCase().indexOf(str) >= 0;
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '出生日期',
|
||||
field: 'birthday',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: false,
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '职称',
|
||||
field: 'doctorTitle',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'z_doct_lev',
|
||||
showSearch: true,
|
||||
filterOption: (input: string, option: any): boolean => {
|
||||
const str: string = input.trim().toLowerCase();
|
||||
return option.label.toLowerCase().indexOf(str) >= 0;
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '擅长',
|
||||
field: 'goodAt',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
{
|
||||
label: '执业经历',
|
||||
field: 'experience',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
{
|
||||
label: '擅长症状',
|
||||
field: 'goodAtSymptom',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
{
|
||||
label: '擅长疾病',
|
||||
field: 'goodAtSickness',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
{
|
||||
label: '注册时间',
|
||||
field: 'createTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: false,
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '健康状况',
|
||||
field: 'healthStatus',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'jk_status',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '毕业院校',
|
||||
field: 'college',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '毕业时间',
|
||||
field: 'graduateDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: false,
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '学历',
|
||||
field: 'education',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'emp_education',
|
||||
showSearch: true,
|
||||
filterOption: (input: string, option: any): boolean => {
|
||||
const str: string = input.trim().toLowerCase();
|
||||
return option.label.toLowerCase().indexOf(str) >= 0;
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '获奖及论文发表',
|
||||
field: 'awardsPapers',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
{
|
||||
label: '工作经历',
|
||||
field: 'resume',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
{
|
||||
label: '入选理由',
|
||||
field: 'reason',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
{
|
||||
field: 'onDutyTime',
|
||||
label: '值班时间',
|
||||
component: 'CheckboxGroup',
|
||||
ifShow: false,
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '周一上午', value: '周一上午' },
|
||||
{ label: '周一下午', value: '周一下午' },
|
||||
{ label: '周二上午', value: '周二上午' },
|
||||
{ label: '周二下午', value: '周二下午' },
|
||||
{ label: '周三上午', value: '周三上午' },
|
||||
{ label: '周三下午', value: '周三下午' },
|
||||
{ label: '周四上午', value: '周四上午' },
|
||||
{ label: '周四下午', value: '周四下午' },
|
||||
{ label: '周五上午', value: '周五上午' },
|
||||
{ label: '周五下午', value: '周五下午' },
|
||||
{ label: '周六上午', value: '周六上午' },
|
||||
{ label: '周六下午', value: '周六下午' },
|
||||
{ label: '周日上午', value: '周日上午' },
|
||||
{ label: '周日下午', value: '周日下午' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
* @param param
|
||||
*/
|
||||
export function getBpmFormSchema(_formData): FormSchema[] {
|
||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
||||
return formSchema;
|
||||
}
|
||||
@@ -1,234 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined" v-auth="'system:health_operator_ex:add'">
|
||||
新增
|
||||
</a-button>
|
||||
<!-- <a-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- preIcon="ant-design:export-outlined"-->
|
||||
<!-- v-auth="'system:health_user_operator_ex:exportXls'"-->
|
||||
<!-- @click="onExportXls"-->
|
||||
<!-- >-->
|
||||
<!-- 导出-->
|
||||
<!-- </a-button>-->
|
||||
<!-- <j-upload-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- preIcon="ant-design:import-outlined"-->
|
||||
<!-- v-auth="'system:health_user_operator_ex:importExcel'"-->
|
||||
<!-- @click="onImportXls"-->
|
||||
<!-- >导入-->
|
||||
<!-- </j-upload-button>-->
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="batchHandleDelete"
|
||||
v-auth="'system:health_operator_ex:deleteBatch'"
|
||||
preIcon="ant-design:delete-outlined"
|
||||
>
|
||||
批量删除
|
||||
</a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template #htmlSlot="{ text }">
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
<template #fileSlot="{ text }">
|
||||
<span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
|
||||
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)"
|
||||
>下载
|
||||
</a-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<healthOperatorExModal @register="registerDrawer" @success="handleSuccess" />
|
||||
<!-- 重置密码 -->
|
||||
<RestPass @register="restPassModal" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="system-healthOperatorEx" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import healthOperatorExModal from './components/healthOperatorExModal.vue';
|
||||
import { columns, searchFormSchema } from './healthOperatorEx.data';
|
||||
import { batchDelete, deleteOne, getExportUrl, getImportUrl, list, resEditData } from './healthOperatorEx.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { lockUser } from '/@/views/system/user/hospitalDoctor/HospitalDoctor.api';
|
||||
import { message } from 'ant-design-vue';
|
||||
import RestPass from '../restPass/RestPass.vue';
|
||||
import { useDrawer } from '/@/components/Drawer';
|
||||
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
|
||||
//注册model
|
||||
const [restPassModal, { openModal: restPaddModel }] = useModal();
|
||||
//注册table数据
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: 'health_user_operator_ex',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
formConfig: {
|
||||
//labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: '操作人员',
|
||||
url: getExportUrl,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess,
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
openDrawer(true, {
|
||||
isUpdate: false,
|
||||
showFooter: true,
|
||||
type: '新增',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
resEditData({ id: record.id }).then((res) => {
|
||||
let data = { ...res.sysUserModel, ...res.healthUserOperatorEx, phone: res.sysUserModel.phone };
|
||||
data.userName = res.sysUserModel.username;
|
||||
openDrawer(true, {
|
||||
record: data,
|
||||
isUpdate: true,
|
||||
showFooter: true,
|
||||
type: '编辑',
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
resEditData({ id: record.id }).then((res) => {
|
||||
let data = { ...res.sysUserModel, ...res.healthUserOperatorEx };
|
||||
data.userName = res.sysUserModel.username;
|
||||
openDrawer(true, {
|
||||
record: data,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
type: '详情',
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
if (selectedRowKeys.value.length === 0) {
|
||||
return message.warning('未选中任何数据');
|
||||
}
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'system:health_operator_ex:edit',
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
// 重置密码
|
||||
function restPass(record) {
|
||||
restPaddModel(true, {
|
||||
record: record.userId,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
});
|
||||
}
|
||||
// 1 锁定用户 2 激活用户
|
||||
async function handleUserOpt(record, type) {
|
||||
const params = {
|
||||
userId: record.userId,
|
||||
status: type,
|
||||
};
|
||||
await lockUser(params, type, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '删除',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
auth: 'system:health_operator_ex:delete',
|
||||
},
|
||||
{
|
||||
label: '重置密码',
|
||||
onClick: restPass.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '锁定用户',
|
||||
auth: 'system:user:frozen',
|
||||
onClick: handleUserOpt.bind(null, record, 2),
|
||||
},
|
||||
{
|
||||
label: '激活用户',
|
||||
auth: 'system:user:frozen',
|
||||
onClick: handleUserOpt.bind(null, record, 1),
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -1,136 +0,0 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { dealPassword } from '/@/views/system/user/user.data';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/sys/healthUserOperatorEx/list',
|
||||
save = '/sys/healthUserOperatorEx/add',
|
||||
edit = '/sys/healthUserOperatorEx/edit',
|
||||
deleteOne = '/sys/healthUserOperatorEx/delete',
|
||||
deleteBatch = '/sys/healthUserOperatorEx/deleteBatch',
|
||||
importExcel = '/sys/healthUserOperatorEx/importExcel',
|
||||
exportXls = '/sys/healthUserOperatorEx/exportXls',
|
||||
getEdit = '/sys/healthUserOperatorEx/queryById',
|
||||
queryById = '/system/healthUserOperatorEx/queryById',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
/**
|
||||
* 编辑页面回显
|
||||
*/
|
||||
export const queryByIdUrl = Api.queryById;
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 请求编辑数据
|
||||
*/
|
||||
export const resEditData = async (params) => {
|
||||
return await defHttp.get({ url: Api.getEdit, params }, { joinParamsToUrl: true });
|
||||
};
|
||||
/**
|
||||
* 删除单个
|
||||
*/
|
||||
export const deleteOne = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp
|
||||
.delete(
|
||||
{
|
||||
url: Api.deleteBatch,
|
||||
data: params,
|
||||
},
|
||||
{ joinParamsToUrl: true }
|
||||
)
|
||||
.then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
let passwordObj = {};
|
||||
if (!isUpdate.value) {
|
||||
passwordObj = {
|
||||
password: dealPassword(params?.password),
|
||||
};
|
||||
}
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
const data = {
|
||||
healthUserOperatorEx: {
|
||||
id: params?.id,
|
||||
userId: params?.userId,
|
||||
userType: params?.userType,
|
||||
nativePlace: params?.nativePlace,
|
||||
nation: params?.nation,
|
||||
doctorTitle: params?.doctorTitle,
|
||||
goodAt: params?.goodAt,
|
||||
experience: params?.experience,
|
||||
goodAtSymptom: params?.goodAtSymptom,
|
||||
goodAtSickness: params?.goodAtSickness,
|
||||
createTime: params?.createTime,
|
||||
cardNo: params?.cardNo,
|
||||
healthStatus: params?.healthStatus,
|
||||
college: params?.college,
|
||||
graduateDate: params?.graduateDate,
|
||||
education: params?.education,
|
||||
awardsPapers: params?.awardsPapers,
|
||||
resume: params?.resume,
|
||||
reason: params?.reason,
|
||||
onDutyTime: params?.onDutyTime,
|
||||
},
|
||||
sysUserModel: {
|
||||
username: params?.username,
|
||||
...passwordObj,
|
||||
realname: params?.realname,
|
||||
birthday: params?.birthday,
|
||||
sex: params?.sex,
|
||||
phone: params?.phone,
|
||||
id: params?.id,
|
||||
avatar: params?.avatar,
|
||||
},
|
||||
};
|
||||
return defHttp.post({ url: url, data });
|
||||
};
|
||||
@@ -1,420 +0,0 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { checkPassword } from '/@/hooks/checkPassword/checkPassword';
|
||||
import { isShowIdCard } from '/@/utils/getEnv';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '用户账号',
|
||||
align: 'center',
|
||||
dataIndex: 'userName',
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
align: 'center',
|
||||
dataIndex: 'realName',
|
||||
},
|
||||
{
|
||||
title: '籍贯',
|
||||
align: 'center',
|
||||
dataIndex: 'nativePlace',
|
||||
},
|
||||
{
|
||||
title: '民族',
|
||||
align: 'center',
|
||||
dataIndex: 'nation',
|
||||
customRender: ({ text }) => {
|
||||
return render.renderDict(text, 'nation') || '';
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '出生日期',
|
||||
align: 'center',
|
||||
dataIndex: 'birthday',
|
||||
customRender: ({ text }) => {
|
||||
return !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '职称',
|
||||
align: 'center',
|
||||
dataIndex: 'doctorTitle',
|
||||
customRender: ({ text }) => {
|
||||
return render.renderDict(text, 'z_doct_lev');
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '擅长',
|
||||
align: 'center',
|
||||
dataIndex: 'goodAt',
|
||||
},
|
||||
{
|
||||
title: '执业经历',
|
||||
align: 'center',
|
||||
dataIndex: 'experience',
|
||||
},
|
||||
{
|
||||
title: '擅长症状',
|
||||
align: 'center',
|
||||
dataIndex: 'goodAtSymptom',
|
||||
},
|
||||
{
|
||||
title: '擅长疾病',
|
||||
align: 'center',
|
||||
dataIndex: 'goodAtSickness',
|
||||
},
|
||||
{
|
||||
title: '注册时间',
|
||||
align: 'center',
|
||||
dataIndex: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '身份证号',
|
||||
align: 'center',
|
||||
dataIndex: 'cardNo',
|
||||
width: 160,
|
||||
ifShow: isShowIdCard(),
|
||||
},
|
||||
{
|
||||
title: '健康状况',
|
||||
align: 'center',
|
||||
dataIndex: 'healthStatus',
|
||||
customRender: ({ text }) => (text && render.renderDict(text, 'jk_status')) || '',
|
||||
},
|
||||
{
|
||||
title: '毕业院校',
|
||||
align: 'center',
|
||||
dataIndex: 'college',
|
||||
},
|
||||
{
|
||||
title: '毕业时间',
|
||||
align: 'center',
|
||||
dataIndex: 'graduateDate',
|
||||
customRender: ({ text }) => {
|
||||
return !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '学历',
|
||||
align: 'center',
|
||||
dataIndex: 'education',
|
||||
customRender: ({ text }) => (text && render.renderDict(text, 'emp_education')) || '',
|
||||
},
|
||||
{
|
||||
title: '获奖及论文发表',
|
||||
align: 'center',
|
||||
dataIndex: 'awardsPapers',
|
||||
},
|
||||
{
|
||||
title: '工作简历',
|
||||
align: 'center',
|
||||
dataIndex: 'resume',
|
||||
},
|
||||
{
|
||||
title: '入选理由',
|
||||
align: 'center',
|
||||
dataIndex: 'reason',
|
||||
},
|
||||
// {
|
||||
// title: '值班时间',
|
||||
// align: 'center',
|
||||
// dataIndex: 'onDutyTime',
|
||||
// },
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'realName',
|
||||
label: '姓名',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '人员类型',
|
||||
field: 'userType',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'p_type',
|
||||
},
|
||||
// required: true,
|
||||
ifShow: false,
|
||||
},
|
||||
{
|
||||
label: '用户账号',
|
||||
field: 'username',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '密码',
|
||||
field: 'password',
|
||||
component: 'StrengthMeter',
|
||||
componentProps: {
|
||||
autocomplete: 'new-password',
|
||||
readOnly: true,
|
||||
onfocus: (field) => {
|
||||
field.target.readOnly = false;
|
||||
},
|
||||
},
|
||||
dynamicRules: () => {
|
||||
return [
|
||||
{
|
||||
required: true,
|
||||
validator: (_, value) => {
|
||||
let { message } = checkPassword(value);
|
||||
if (message === 'ok') {
|
||||
return Promise.resolve();
|
||||
} else {
|
||||
return Promise.reject(message);
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
},
|
||||
];
|
||||
},
|
||||
show: ({ values }) => {
|
||||
return !values.id;
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '姓名',
|
||||
field: 'realname',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '性别',
|
||||
field: 'sex',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'sex2',
|
||||
type: 'radio',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '头像',
|
||||
field: 'avatar',
|
||||
component: 'JImageUpload',
|
||||
componentProps: {
|
||||
maxCount: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
field: 'phone',
|
||||
component: 'Input',
|
||||
rules: [{ required: true, pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误' }],
|
||||
},
|
||||
{
|
||||
label: '身份证号',
|
||||
field: 'cardNo',
|
||||
component: 'Input',
|
||||
rules: [
|
||||
{ required: true, pattern: /^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|[xX])$/, message: '身份证号码格式有误' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '籍贯',
|
||||
field: 'nativePlace',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '民族',
|
||||
field: 'nation',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: () => {
|
||||
return {
|
||||
dictCode: 'nation',
|
||||
showSearch: true,
|
||||
filterOption: (input: string, option: any): boolean => {
|
||||
const str: string = input.toLowerCase();
|
||||
return option.label.toLowerCase().indexOf(str) >= 0;
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '出生日期',
|
||||
field: 'birthday',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: false,
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '职称',
|
||||
field: 'doctorTitle',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'z_doct_lev',
|
||||
showSearch: true,
|
||||
filterOption: (input: string, option: any): boolean => {
|
||||
const str: string = input.trim().toLowerCase();
|
||||
return option.label.toLowerCase().indexOf(str) >= 0;
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '毕业时间',
|
||||
field: 'graduateDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: false,
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '学历',
|
||||
field: 'education',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'emp_education',
|
||||
showSearch: true,
|
||||
filterOption: (input: string, option: any): boolean => {
|
||||
const str: string = input.trim().toLowerCase();
|
||||
return option.label.toLowerCase().indexOf(str) >= 0;
|
||||
},
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '值班时间',
|
||||
// field: 'onDutyTime',
|
||||
// component: 'CheckboxGroup',
|
||||
// componentProps: {
|
||||
// options: [
|
||||
// {
|
||||
// label: '周一上午',
|
||||
// value: '周一上午',
|
||||
// },
|
||||
// {
|
||||
// label: '周一下午',
|
||||
// value: '周一下午',
|
||||
// },
|
||||
// {
|
||||
// label: '周二上午',
|
||||
// value: '周二上午',
|
||||
// },
|
||||
// {
|
||||
// label: '周二下午',
|
||||
// value: '周二下午',
|
||||
// },
|
||||
// {
|
||||
// label: '周三上午',
|
||||
// value: '周三上午',
|
||||
// },
|
||||
// {
|
||||
// label: '周三下午',
|
||||
// value: '周三下午',
|
||||
// },
|
||||
// {
|
||||
// label: '周四上午',
|
||||
// value: '周四上午',
|
||||
// },
|
||||
// {
|
||||
// label: '周四下午',
|
||||
// value: '周四下午',
|
||||
// },
|
||||
// {
|
||||
// label: '周五上午',
|
||||
// value: '周五上午',
|
||||
// },
|
||||
// {
|
||||
// label: '周五下午',
|
||||
// value: '周五下午',
|
||||
// },
|
||||
// {
|
||||
// label: '周六上午',
|
||||
// value: '周六上午',
|
||||
// },
|
||||
// {
|
||||
// label: '周六下午',
|
||||
// value: '周六下午',
|
||||
// },
|
||||
// {
|
||||
// label: '周日上午',
|
||||
// value: '周日上午',
|
||||
// },
|
||||
// {
|
||||
// label: '周日下午',
|
||||
// value: '周日下午',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// },
|
||||
{
|
||||
label: '擅长',
|
||||
field: 'goodAt',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
{
|
||||
label: '执业经历',
|
||||
field: 'experience',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
{
|
||||
label: '擅长症状',
|
||||
field: 'goodAtSymptom',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
{
|
||||
label: '擅长疾病',
|
||||
field: 'goodAtSickness',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
{
|
||||
label: '注册时间',
|
||||
field: 'createTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: false,
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '健康状况',
|
||||
field: 'healthStatus',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'jk_status',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '毕业院校',
|
||||
field: 'college',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '获奖及论文发表',
|
||||
field: 'awardsPapers',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
{
|
||||
label: '工作简历',
|
||||
field: 'resume',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
{
|
||||
label: '入选理由',
|
||||
field: 'reason',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
* @param param
|
||||
*/
|
||||
export function getBpmFormSchema(_formData): FormSchema[] {
|
||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
||||
return formSchema;
|
||||
}
|
||||
@@ -1,232 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined" v-auth="'system:health_user_operator_ex:add'">
|
||||
新增
|
||||
</a-button>
|
||||
<!-- <a-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- preIcon="ant-design:export-outlined"-->
|
||||
<!-- v-auth="'system:health_user_operator_ex:exportXls'"-->
|
||||
<!-- @click="onExportXls"-->
|
||||
<!-- >-->
|
||||
<!-- 导出-->
|
||||
<!-- </a-button>-->
|
||||
<!-- <j-upload-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- preIcon="ant-design:import-outlined"-->
|
||||
<!-- v-auth="'system:health_user_operator_ex:importExcel'"-->
|
||||
<!-- @click="onImportXls"-->
|
||||
<!-- >导入-->
|
||||
<!-- </j-upload-button>-->
|
||||
<a-button
|
||||
type="primary"
|
||||
preIcon="ant-design:delete-outlined"
|
||||
v-auth="'system:health_user_operator_ex:deleteBatch'"
|
||||
@click="batchHandleDelete"
|
||||
>批量删除</a-button
|
||||
>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template #htmlSlot="{ text }">
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
<template #fileSlot="{ text }">
|
||||
<span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
|
||||
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)"
|
||||
>下载
|
||||
</a-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<HealthUserOperatorExModal :userId="userId" @register="registerDrawer" @success="handleSuccess" />
|
||||
<!-- 重置密码 -->
|
||||
<RestPass @register="restPassModal" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="system-healthUserOperatorEx" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import HealthUserOperatorExModal from './components/HealthUserOperatorExModal.vue';
|
||||
import RestPass from '../restPass/RestPass.vue';
|
||||
import { columns, searchFormSchema } from './HealthUserOperatorEx.data';
|
||||
import { batchDelete, deleteOne, getExportUrl, getImportUrl, list, resEditData } from './HealthUserOperatorEx.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { lockUser } from '/@/views/system/user/hospitalDoctor/HospitalDoctor.api';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { useDrawer } from '/@/components/Drawer';
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const userId = ref<String>('');
|
||||
//注册model
|
||||
const [restPassModal, { openModal: restPaddModel }] = useModal();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: 'health_user_operator_ex',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
formConfig: {
|
||||
//labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: '专业人员',
|
||||
url: getExportUrl,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess,
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
openDrawer(true, {
|
||||
isUpdate: false,
|
||||
showFooter: true,
|
||||
type: '新增',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
userId.value = record.userId;
|
||||
resEditData({ id: record.id }).then((res) => {
|
||||
let data = { ...res.sysUserModel, ...res.healthUserOperatorEx };
|
||||
data.phone = res.sysUserModel.phone;
|
||||
openDrawer(true, {
|
||||
record: data,
|
||||
isUpdate: true,
|
||||
showFooter: true,
|
||||
type: '编辑',
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
resEditData({ id: record.id }).then((res) => {
|
||||
let data = { ...res.sysUserModel, ...res.healthUserOperatorEx };
|
||||
data.phone = res.sysUserModel.phone;
|
||||
openDrawer(true, {
|
||||
record: data,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
type: '详情',
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
if (selectedRowKeys.value.length === 0) {
|
||||
return message.warning('未选中任何数据');
|
||||
}
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'system:health_user_operator_ex:edit',
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
// 重置密码
|
||||
function restPass(record) {
|
||||
restPaddModel(true, {
|
||||
record: record.userId,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
});
|
||||
}
|
||||
// 1 锁定用户 2 激活用户
|
||||
async function handleUserOpt(record, type) {
|
||||
const params = {
|
||||
userId: record.userId,
|
||||
status: type,
|
||||
};
|
||||
await lockUser(params, type, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '删除',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
auth: 'system:health_user_operator_ex:delete',
|
||||
},
|
||||
{
|
||||
label: '重置密码',
|
||||
onClick: restPass.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '锁定用户',
|
||||
auth: 'system:user:frozen',
|
||||
onClick: handleUserOpt.bind(null, record, 2),
|
||||
},
|
||||
{
|
||||
label: '激活用户',
|
||||
auth: 'system:user:frozen',
|
||||
onClick: handleUserOpt.bind(null, record, 1),
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -1,68 +0,0 @@
|
||||
<template>
|
||||
<div style="min-height: 400px">
|
||||
<BasicForm @register="registerForm" />
|
||||
<div v-if="!formDisabled" style="width: 100%; text-align: center">
|
||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { BasicForm, useForm } from '/@/components/Form';
|
||||
import { computed, defineComponent } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import { getBpmFormSchema } from '../HealthUserOperatorEx.data';
|
||||
import { queryByIdUrl, saveOrUpdate } from '../HealthUserOperatorEx.api';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'HealthUserOperatorExForm',
|
||||
components: {
|
||||
BasicForm,
|
||||
},
|
||||
props: {
|
||||
formData: propTypes.object.def({}),
|
||||
formBpm: propTypes.bool.def(true),
|
||||
},
|
||||
setup(props) {
|
||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: getBpmFormSchema(props.formData),
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
const formDisabled = computed(() => {
|
||||
if (props.formData.disabled === false) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
let formData = {};
|
||||
async function initFormData() {
|
||||
let params = { id: props.formData.dataId };
|
||||
const data = await defHttp.get({ url: queryByIdUrl, params });
|
||||
formData = { ...data };
|
||||
//设置表单的值
|
||||
await setFieldsValue(formData);
|
||||
//默认是禁用
|
||||
await setProps({ disabled: formDisabled.value });
|
||||
}
|
||||
|
||||
async function submitForm() {
|
||||
let data = getFieldsValue();
|
||||
let params = Object.assign({}, formData, data);
|
||||
await saveOrUpdate(params, true);
|
||||
}
|
||||
|
||||
initFormData();
|
||||
|
||||
return {
|
||||
registerForm,
|
||||
formDisabled,
|
||||
submitForm,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@@ -1,98 +0,0 @@
|
||||
<template>
|
||||
<BasicDrawer
|
||||
:maskClosable="false"
|
||||
:title="title"
|
||||
:width="adaptiveWidth"
|
||||
:showFooter="showFooter"
|
||||
v-bind="$attrs"
|
||||
@register="registerDrawer"
|
||||
destroyOnClose
|
||||
@ok="handleSubmit"
|
||||
>
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, defineProps, ref, unref } from 'vue';
|
||||
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
|
||||
import { BasicForm, useForm } from '/@/components/Form';
|
||||
import { formSchema } from '../HealthUserOperatorEx.data';
|
||||
import { saveOrUpdate } from '../HealthUserOperatorEx.api';
|
||||
import { useDrawerAdaptiveWidth } from '/@/hooks/jeecg/useAdaptiveWidth';
|
||||
const { adaptiveWidth } = useDrawerAdaptiveWidth();
|
||||
// Emits声明
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref<boolean>(true);
|
||||
const showFooter = ref<boolean>(true);
|
||||
//设置标题
|
||||
const title = ref(String);
|
||||
const props = defineProps({
|
||||
userId: String,
|
||||
});
|
||||
//表单配置
|
||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, clearValidate, updateSchema }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
//表单赋值
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
setDrawerProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
showFooter.value = data.showFooter;
|
||||
title.value = data.type;
|
||||
if (unref(isUpdate)) {
|
||||
//表单赋值
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
await updateSchema([
|
||||
{
|
||||
field: 'password',
|
||||
ifShow: false,
|
||||
},
|
||||
]);
|
||||
await clearValidate();
|
||||
} else {
|
||||
await updateSchema([
|
||||
{
|
||||
field: 'password',
|
||||
ifShow: true,
|
||||
},
|
||||
]);
|
||||
}
|
||||
// 隐藏底部时禁用整个表单
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
//表单提交事件
|
||||
async function handleSubmit(v) {
|
||||
try {
|
||||
let values = await validate();
|
||||
values.userId = props.userId;
|
||||
setDrawerProps({ confirmLoading: true });
|
||||
//提交表单
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
//关闭弹窗
|
||||
closeDrawer();
|
||||
//刷新列表
|
||||
emit('success');
|
||||
} finally {
|
||||
setDrawerProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
/** 时间和数字输入框样式 */
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.ant-calendar-picker) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -1,132 +0,0 @@
|
||||
import { defHttp } from "/@/utils/http/axios";
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
import { dealPassword } from "/@/views/system/user/user.data";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/sys/healthUserStationEx/list',
|
||||
save = '/sys/healthUserStationEx/add',
|
||||
edit = '/sys/healthUserStationEx/edit',
|
||||
deleteOne = '/sys/healthUserStationEx/delete',
|
||||
deleteBatch = '/sys/healthUserStationEx/deleteBatch',
|
||||
importExcel = '/sys/healthUserStationEx/importExcel',
|
||||
exportXls = '/sys/healthUserStationEx/exportXls',
|
||||
getEdit = '/sys/healthUserStationEx/queryById',
|
||||
getHospitals = '/rest/consult/r/h/list',
|
||||
queryById = '/system/healthUserStationEx/queryById',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
/**
|
||||
* 编辑页面回显
|
||||
*/
|
||||
export const queryByIdUrl = Api.queryById;
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 请求编辑数据
|
||||
*/
|
||||
export const resEditData = async (params) => {
|
||||
return await defHttp.get({ url: Api.getEdit, params }, { joinParamsToUrl: true });
|
||||
};
|
||||
|
||||
/**
|
||||
* 医院列表
|
||||
*/
|
||||
export const hospitalLists = async (params) => {
|
||||
return await defHttp.get({ url: Api.getHospitals, params });
|
||||
};
|
||||
/**
|
||||
* 删除单个
|
||||
*/
|
||||
export const deleteOne = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp
|
||||
.delete(
|
||||
{
|
||||
url: Api.deleteBatch,
|
||||
data: params,
|
||||
},
|
||||
{ joinParamsToUrl: true }
|
||||
)
|
||||
.then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
let passwordObj = {};
|
||||
if (!isUpdate.value) {
|
||||
passwordObj = {
|
||||
password: dealPassword(params?.password),
|
||||
};
|
||||
}
|
||||
const url = isUpdate ? Api.edit : Api.save,
|
||||
data = {
|
||||
healthUserStationEx: {
|
||||
id: params?.id,
|
||||
hospitalId: params?.hospitalId,
|
||||
hospitalName: params?.hospitalName,
|
||||
memo: params?.memo,
|
||||
},
|
||||
sysUserModel: {
|
||||
realname: params?.realname,
|
||||
username: params?.username,
|
||||
sex: params?.sex,
|
||||
avatar: params?.avatar,
|
||||
idCard: params?.idCard,
|
||||
birthday: params?.birthday,
|
||||
email: params?.email,
|
||||
phone: params?.phone,
|
||||
workNo: params?.workNo,
|
||||
...passwordObj,
|
||||
post: params?.post,
|
||||
orgCode: params?.orgCode,
|
||||
id: params?.id,
|
||||
},
|
||||
};
|
||||
return defHttp.post({ url: url, data });
|
||||
};
|
||||
@@ -1,232 +0,0 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { getNewHospitalApi, getPhysicalHospitalsList } from '../user.api';
|
||||
import { checkPassword } from '/@/hooks/checkPassword/checkPassword';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '用户账号',
|
||||
align: 'center',
|
||||
dataIndex: 'userName',
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
align: 'center',
|
||||
dataIndex: 'realName',
|
||||
},
|
||||
{
|
||||
title: '医院',
|
||||
align: 'center',
|
||||
dataIndex: 'hospitalName',
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'realName',
|
||||
label: '姓名',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '医院',
|
||||
field: 'hospitalId',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: getNewHospitalApi,
|
||||
resultField: 'list',
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
immediate: false,
|
||||
placeholder: '请选择驻场医院',
|
||||
},
|
||||
},
|
||||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '医院',
|
||||
field: 'hospitalName',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
getPopupContainer: () => document.body,
|
||||
api: getNewHospitalApi,
|
||||
resultField: 'list',
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
immediate: false,
|
||||
// onChange: (e) => {
|
||||
// console.log('selected:', e);
|
||||
// },
|
||||
// // 请求后回调
|
||||
// onOptionsChange: (options) => {
|
||||
// console.log('get options', options.length, options);
|
||||
// },
|
||||
onOptionsChange: (options) => {
|
||||
// console.log("options",options)
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '用户账号',
|
||||
field: 'username',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
componentProps: {
|
||||
autocomplete: 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '密码',
|
||||
field: 'password',
|
||||
component: 'StrengthMeter',
|
||||
required: true,
|
||||
componentProps: {
|
||||
autocomplete: 'new-password',
|
||||
readOnly: true,
|
||||
onfocus: (field) => {
|
||||
field.target.readOnly = false;
|
||||
},
|
||||
},
|
||||
dynamicRules: () => {
|
||||
return [
|
||||
{
|
||||
required: true,
|
||||
validator: (_, value) => {
|
||||
let { message } = checkPassword(value);
|
||||
if (message === 'ok') {
|
||||
return Promise.resolve();
|
||||
} else {
|
||||
return Promise.reject(message);
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
},
|
||||
];
|
||||
},
|
||||
show: ({ values }) => {
|
||||
return !values.id;
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
field: 'hospitalId', // 医院名称选中的医院ID
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
label: '姓名',
|
||||
field: 'realname',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
field: 'sex',
|
||||
component: 'JDictSelectTag',
|
||||
label: '性别',
|
||||
colProps: {
|
||||
span: 24,
|
||||
},
|
||||
componentProps: {
|
||||
type: 'radio',
|
||||
dictCode: 'sex2',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
field: 'avatar',
|
||||
label: '头像',
|
||||
component: 'JImageUpload',
|
||||
componentProps: {
|
||||
text: '头像',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
field: 'phone',
|
||||
component: 'Input',
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
pattern: /^1[3456789][0-9]{9}$/,
|
||||
message: '${label}格式有误',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '身份证号',
|
||||
field: 'idCard',
|
||||
component: 'Input',
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
|
||||
message: '${label}格式有误',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '出生日期',
|
||||
field: 'birthday',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: false,
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
placeholder: '请选择出生日期',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '邮箱',
|
||||
field: 'email',
|
||||
component: 'Input',
|
||||
rules: [
|
||||
{
|
||||
pattern: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
|
||||
message: '${label}格式有误',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '员工编号', // 原来为工号
|
||||
field: 'workNo',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '人员类型',
|
||||
field: 'personType',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'p_type',
|
||||
},
|
||||
show: false,
|
||||
},
|
||||
// {
|
||||
// label: '职务',
|
||||
// field: 'post',
|
||||
// component: 'Input',
|
||||
// },
|
||||
{
|
||||
label: '部门编码',
|
||||
field: 'orgCode',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
* @param param
|
||||
*/
|
||||
export function getBpmFormSchema(_formData): FormSchema[] {
|
||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
||||
return formSchema;
|
||||
}
|
||||
@@ -1,218 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #customSlot="{ model, field }">
|
||||
<a-input v-model:value="model[field]" />
|
||||
</template>
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button v-auth="'system:health_user_station_ex:add'" type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined">
|
||||
新增
|
||||
</a-button>
|
||||
<!-- <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出 </a-button>-->
|
||||
<!-- <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入 </j-upload-button>-->
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'system:health_user_station_ex:deleteBatch'"
|
||||
preIcon="ant-design:delete-outlined"
|
||||
@click="batchHandleDelete"
|
||||
>批量删除</a-button
|
||||
>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template #htmlSlot="{ text }">
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
<template #fileSlot="{ text }">
|
||||
<span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
|
||||
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)"
|
||||
>下载
|
||||
</a-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<HealthUserStationExModal @register="registerDrawer" @success="handleSuccess" />
|
||||
<!-- 重置密码 -->
|
||||
<RestPass @register="restPassModal" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="system-healthUserStationEx" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useDrawer } from '/@/components/Drawer';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import HealthUserStationExModal from './components/HealthUserStationExModal.vue';
|
||||
import RestPass from '../restPass/RestPass.vue';
|
||||
import { columns, searchFormSchema } from './HealthUserStationEx.data';
|
||||
import { batchDelete, deleteOne, getExportUrl, getImportUrl, list, resEditData } from './HealthUserStationEx.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { lockUser } from '/@/views/system/user/hospitalDoctor/HospitalDoctor.api';
|
||||
import { message } from 'ant-design-vue';
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
//注册model
|
||||
const [restPassModal, { openModal: restPaddModel }] = useModal();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: 'health_user_station_ex',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
formConfig: {
|
||||
//labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 220,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: '驻场人员',
|
||||
url: getExportUrl,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess,
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
openDrawer(true, {
|
||||
isUpdate: false,
|
||||
showFooter: true,
|
||||
});
|
||||
}
|
||||
// 重置密码
|
||||
function restPass(record) {
|
||||
restPaddModel(true, {
|
||||
record: record.id,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
type: '新增',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
resEditData({ id: record.id }).then((res) => {
|
||||
let data = { ...res.sysUserModel, ...res.healthUserStationEx };
|
||||
openDrawer(true, {
|
||||
record: data,
|
||||
isUpdate: true,
|
||||
showFooter: true,
|
||||
type: '编辑',
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
resEditData({ id: record.id }).then((res) => {
|
||||
let data = { ...res.sysUserModel, ...res.healthUserStationEx };
|
||||
openDrawer(true, {
|
||||
record: data,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
type: '详情',
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
if (selectedRowKeys.value.length === 0) {
|
||||
return message.warning('未选中任何数据');
|
||||
}
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'system:health_user_station_ex:edit',
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
auth: 'system:health_user_station_ex:delete',
|
||||
},
|
||||
];
|
||||
}
|
||||
// 1 锁定用户 2 激活用户
|
||||
async function handleUserOpt(record, type) {
|
||||
const params = {
|
||||
userId: record.id,
|
||||
status: type,
|
||||
};
|
||||
await lockUser(params, type, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '重置密码',
|
||||
onClick: restPass.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '锁定用户',
|
||||
auth: 'system:user:frozen',
|
||||
onClick: handleUserOpt.bind(null, record, 2),
|
||||
},
|
||||
{
|
||||
label: '激活用户',
|
||||
auth: 'system:user:frozen',
|
||||
onClick: handleUserOpt.bind(null, record, 1),
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -1,68 +0,0 @@
|
||||
<template>
|
||||
<div style="min-height: 400px">
|
||||
<BasicForm @register="registerForm" />
|
||||
<div v-if="!formDisabled" style="width: 100%; text-align: center">
|
||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { BasicForm, useForm } from '/@/components/Form';
|
||||
import { computed, defineComponent } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import { getBpmFormSchema } from '../HealthUserStationEx.data';
|
||||
import { queryByIdUrl, saveOrUpdate } from '../HealthUserStationEx.api';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'HealthUserStationExForm',
|
||||
components: {
|
||||
BasicForm,
|
||||
},
|
||||
props: {
|
||||
formData: propTypes.object.def({}),
|
||||
formBpm: propTypes.bool.def(true),
|
||||
},
|
||||
setup(props) {
|
||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: getBpmFormSchema(props.formData),
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
const formDisabled = computed(() => {
|
||||
if (props.formData.disabled === false) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
let formData = {};
|
||||
async function initFormData() {
|
||||
let params = { id: props.formData.dataId };
|
||||
const data = await defHttp.get({ url: queryByIdUrl, params });
|
||||
formData = { ...data };
|
||||
//设置表单的值
|
||||
await setFieldsValue(formData);
|
||||
//默认是禁用
|
||||
await setProps({ disabled: formDisabled.value });
|
||||
}
|
||||
|
||||
async function submitForm() {
|
||||
let data = getFieldsValue();
|
||||
let params = Object.assign({}, formData, data);
|
||||
await saveOrUpdate(params, true);
|
||||
}
|
||||
|
||||
initFormData();
|
||||
|
||||
return {
|
||||
registerForm,
|
||||
formDisabled,
|
||||
submitForm,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@@ -1,110 +0,0 @@
|
||||
<template>
|
||||
<BasicDrawer
|
||||
:maskClosable="false"
|
||||
:title="title"
|
||||
:width="adaptiveWidth"
|
||||
:showFooter="showFooter"
|
||||
destroyOnClose
|
||||
v-bind="$attrs"
|
||||
@ok="handleSubmit"
|
||||
@register="registerDrawer"
|
||||
>
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, unref } from 'vue';
|
||||
import { BasicForm, useForm } from '/@/components/Form';
|
||||
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
|
||||
import { formSchema } from '../HealthUserStationEx.data';
|
||||
import { saveOrUpdate } from '../HealthUserStationEx.api';
|
||||
import { useDrawerAdaptiveWidth } from '/@/hooks/jeecg/useAdaptiveWidth';
|
||||
const { adaptiveWidth } = useDrawerAdaptiveWidth();
|
||||
// Emits声明
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref<boolean>(true);
|
||||
const showFooter = ref<boolean>(true);
|
||||
//设置标题
|
||||
const title = ref(String);
|
||||
//表单配置
|
||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, clearValidate, updateSchema }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
formSchema[0].componentProps.onOptionsChange = (options) => {
|
||||
onSelectHospital(options);
|
||||
};
|
||||
//表单赋值
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
setDrawerProps({
|
||||
confirmLoading: false,
|
||||
showCancelBtn: !!data?.showFooter,
|
||||
showOkBtn: !!data?.showFooter,
|
||||
});
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
showFooter.value = data.showFooter;
|
||||
title.value = data.type;
|
||||
if (unref(isUpdate)) {
|
||||
//表单赋值
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
await updateSchema([
|
||||
{
|
||||
field: 'password',
|
||||
ifShow: false,
|
||||
},
|
||||
]);
|
||||
await clearValidate();
|
||||
} else {
|
||||
await updateSchema([
|
||||
{
|
||||
field: 'password',
|
||||
ifShow: true,
|
||||
},
|
||||
]);
|
||||
}
|
||||
// 隐藏底部时禁用整个表单
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
|
||||
//表单提交事件
|
||||
async function handleSubmit(v) {
|
||||
try {
|
||||
let values = await validate();
|
||||
setDrawerProps({ confirmLoading: true });
|
||||
//提交表单
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
//关闭弹窗
|
||||
closeDrawer();
|
||||
//刷新列表
|
||||
emit('success');
|
||||
} finally {
|
||||
setDrawerProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
|
||||
// 选择医院名称
|
||||
async function onSelectHospital(options) {
|
||||
await setFieldsValue({
|
||||
hospitalName: options[0]['label'],
|
||||
hospitalId: options[0]['value'],
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
/** 时间和数字输入框样式 */
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.ant-calendar-picker) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -1,184 +0,0 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { getPhysicalHospitalsList } from '/@/views/system/user/user.api';
|
||||
import { checkPassword } from '/@/hooks/checkPassword/checkPassword';
|
||||
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '用户账号',
|
||||
align: 'center',
|
||||
dataIndex: 'username',
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
align: 'center',
|
||||
dataIndex: 'realname',
|
||||
},
|
||||
{
|
||||
title: '医院',
|
||||
align: 'center',
|
||||
dataIndex: 'hospitalName',
|
||||
},
|
||||
{
|
||||
title: '账号类型',
|
||||
align: 'center',
|
||||
dataIndex: 'pType_dictText',
|
||||
},
|
||||
{
|
||||
title: '账号状态',
|
||||
align: 'center',
|
||||
dataIndex: 'status_dictText',
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '用户账号',
|
||||
field: 'username',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'realname',
|
||||
label: '姓名',
|
||||
width: 150,
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '医院',
|
||||
field: 'hospitalId',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: getPhysicalHospitalsList,
|
||||
resultField: 'list',
|
||||
labelField: 'hospitalName',
|
||||
valueField: 'hospitalId',
|
||||
immediate: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '账号类型',
|
||||
field: 'pType',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '医院检查医生', value: '10' },
|
||||
{ label: '医院管理员', value: '9' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
label: '账号状态',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'hospital_status',
|
||||
},
|
||||
},
|
||||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '所属医院',
|
||||
field: 'hospitalId',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: getPhysicalHospitalsList,
|
||||
resultField: 'list',
|
||||
labelField: 'hospitalName',
|
||||
valueField: 'hospitalId',
|
||||
immediate: true,
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '账号类型',
|
||||
field: 'pType',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '医院检查医生', value: '10' },
|
||||
{ label: '医院管理员', value: '9' },
|
||||
],
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '用户账号',
|
||||
field: 'username',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
autocomplete: 'off',
|
||||
},
|
||||
dynamicRules: ({ model }) => {
|
||||
return [{ required: !model.id, message: '请输入账号' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '密码',
|
||||
field: 'password',
|
||||
component: 'StrengthMeter',
|
||||
componentProps: {
|
||||
autocomplete: 'new-password',
|
||||
readOnly: true,
|
||||
onfocus: (field) => {
|
||||
field.target.readOnly = false;
|
||||
},
|
||||
},
|
||||
dynamicRules: ({ model }) => {
|
||||
return [
|
||||
{
|
||||
required: !model.id,
|
||||
validator: (_, value) => {
|
||||
let { message } = checkPassword(value);
|
||||
if (message === 'ok') {
|
||||
return Promise.resolve();
|
||||
} else {
|
||||
return Promise.reject(message);
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '姓名',
|
||||
field: 'realname',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '账号状态',
|
||||
field: 'status',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
type: 'radio',
|
||||
dictCode: 'hospital_status',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
dynamicRules: ({ model }) => {
|
||||
return [{ required: model.id, message: '请选择账号状态' }];
|
||||
},
|
||||
ifShow: ({ values }) => {
|
||||
return values.id;
|
||||
},
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
* @param param
|
||||
*/
|
||||
export function getBpmFormSchema(_formData): FormSchema[] {
|
||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
||||
return formSchema;
|
||||
}
|
||||
@@ -1,223 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #customSlot="{ model, field }">
|
||||
<a-input v-model:value="model[field]" />
|
||||
</template>
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined" v-auth="'medical:medical_hospital_user:add'">
|
||||
新增
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'medical:medical_hospital_user:deleteBatch'"
|
||||
@click="batchHandleDelete"
|
||||
preIcon="ant-design:delete-outlined"
|
||||
>
|
||||
批量删除
|
||||
</a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template #htmlSlot="{ text }">
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
<template #fileSlot="{ text }">
|
||||
<span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
|
||||
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)"
|
||||
>下载
|
||||
</a-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<HealthUserStationExModal @register="registerModal" @success="handleSuccess" />
|
||||
<CheckPageTable ref="pageTableRef" @register="registerCheckTable" @success="handleSuccess" />
|
||||
<!-- 重置密码 -->
|
||||
<RestPass @register="restPassModal" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="system-hospitalDoctor" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import HealthUserStationExModal from './components/HospitalDoctorModal.vue';
|
||||
import CheckPageTable from './components/checkPageTable/CheckPageTable.vue';
|
||||
import { columns, searchFormSchema } from './HospitalDoctor.data';
|
||||
import { batchDelete, deleteOne, list, lockUser, configuredLists } from './HospitalDoctor.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { message } from 'ant-design-vue';
|
||||
import RestPass from '../restPass/RestPass.vue';
|
||||
|
||||
//注册model
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const [restPassModal, { openModal: restPaddModel }] = useModal();
|
||||
const [registerCheckTable, { openModal: openHosModal }] = useModal();
|
||||
const pageTableRef = ref();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: 'hospitalDoctor',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
formConfig: {
|
||||
// labelWidth: 80,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 220,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
openModal(true, {
|
||||
isUpdate: false,
|
||||
showFooter: true,
|
||||
type: '新增',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: true,
|
||||
type: '编辑',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
type: '详情',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
if (selectedRowKeys.value.length === 0) {
|
||||
return message.warning('未选中任何数据');
|
||||
}
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
async function handleExamination(record) {
|
||||
const params = {
|
||||
doctorId: record.userId,
|
||||
};
|
||||
const res = await configuredLists(params);
|
||||
openHosModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
});
|
||||
setTimeout(() => {
|
||||
pageTableRef.value && pageTableRef?.value?.updateSource(res);
|
||||
}, 200);
|
||||
}
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'medical:medical_hospital_user:edit',
|
||||
},
|
||||
{
|
||||
label: '配置体检项',
|
||||
onClick: handleExamination.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
// 重置密码
|
||||
function restPass(record) {
|
||||
restPaddModel(true, {
|
||||
record: record.userId,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
});
|
||||
}
|
||||
// 1 锁定用户 2 激活用户
|
||||
async function handleUserOpt(record, type) {
|
||||
const params = {
|
||||
userId: record.userId,
|
||||
status: type,
|
||||
};
|
||||
await lockUser(params, type, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
auth: 'medical:medical_hospital_user:delete',
|
||||
},
|
||||
{
|
||||
label: '重置密码',
|
||||
onClick: restPass.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '锁定用户',
|
||||
auth: 'system:user:frozen',
|
||||
onClick: handleUserOpt.bind(null, record, 2),
|
||||
},
|
||||
{
|
||||
label: '激活用户',
|
||||
auth: 'system:user:frozen',
|
||||
onClick: handleUserOpt.bind(null, record, 1),
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -1,57 +0,0 @@
|
||||
<template>
|
||||
<div style="min-height: 400px">
|
||||
<BasicForm @register="registerForm" />
|
||||
<div v-if="!formDisabled" style="width: 100%; text-align: center">
|
||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { BasicForm, useForm } from '/@/components/Form';
|
||||
import { computed, defineComponent } from 'vue';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import { getBpmFormSchema } from '../HospitalDoctor.data';
|
||||
import { saveOrUpdate } from '../HospitalDoctor.api';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'HealthUserStationExForm',
|
||||
components: {
|
||||
BasicForm,
|
||||
},
|
||||
props: {
|
||||
formData: propTypes.object.def({}),
|
||||
formBpm: propTypes.bool.def(true),
|
||||
},
|
||||
setup(props) {
|
||||
const [registerForm, { getFieldsValue }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: getBpmFormSchema(props.formData),
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
const formDisabled = computed(() => {
|
||||
if (props.formData.disabled === false) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
let formData = {};
|
||||
|
||||
async function submitForm() {
|
||||
let data = getFieldsValue();
|
||||
let params = Object.assign({}, formData, data);
|
||||
await saveOrUpdate(params, true);
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
registerForm,
|
||||
formDisabled,
|
||||
submitForm,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@@ -1,74 +0,0 @@
|
||||
<template>
|
||||
<BasicModal :title="title" :width="800" destroyOnClose v-bind="$attrs" @ok="handleSubmit" @register="registerModal">
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, unref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form';
|
||||
import { formSchema } from '../HospitalDoctor.data';
|
||||
import { saveOrUpdate } from '../HospitalDoctor.api';
|
||||
import { dealParams } from '/@/views/system/user/user.data';
|
||||
// Emits声明
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
//设置标题
|
||||
const title = ref(String);
|
||||
//表单配置
|
||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, updateSchema, clearValidate }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
title.value = data.type;
|
||||
if (unref(isUpdate)) {
|
||||
//表单赋值
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
await clearValidate();
|
||||
}
|
||||
updateSchema([
|
||||
{ field: 'username', ifShow: !unref(isUpdate) },
|
||||
{ field: 'password', ifShow: !unref(isUpdate) },
|
||||
{ field: 'hospitalId', dynamicDisabled: unref(isUpdate) },
|
||||
{ field: 'pType', dynamicDisabled: unref(isUpdate) },
|
||||
]);
|
||||
// 隐藏底部时禁用整个表单
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
//表单提交事件
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
let values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
//提交表单
|
||||
await saveOrUpdate(dealParams(values), isUpdate.value);
|
||||
//关闭弹窗
|
||||
closeModal();
|
||||
//刷新列表
|
||||
emit('success');
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
/** 时间和数字输入框样式 */
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.ant-calendar-picker) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
-71
@@ -1,71 +0,0 @@
|
||||
import { BasicColumn } from '/@/components/Table';
|
||||
import { FormSchema } from '/@/components/Table';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '体检项名称',
|
||||
align: 'center',
|
||||
dataIndex: 'itemName',
|
||||
},
|
||||
{
|
||||
title: '体检项类型',
|
||||
align: 'center',
|
||||
dataIndex: 'checkItemType_dictText',
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '体检项目名称',
|
||||
field: 'itemName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '体检项类型',
|
||||
field: 'checkItemType',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'check_item_type',
|
||||
},
|
||||
// colProps: { span: 8 },
|
||||
},
|
||||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
];
|
||||
|
||||
// 配置体检项数据
|
||||
|
||||
// 列表数据
|
||||
export const TransferColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '体检项名称',
|
||||
align: 'center',
|
||||
key: 'checkItemName',
|
||||
},
|
||||
{
|
||||
title: '体检项类型',
|
||||
align: 'center',
|
||||
key: 'checkItemType_dictText',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
* @param _formData
|
||||
*/
|
||||
export function getBpmFormSchema(_formData): FormSchema[] {
|
||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
||||
return formSchema;
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="1200" @ok="handleSubmit" @cancel="cancel">
|
||||
<div class="configuration-module">
|
||||
<BasicTable class="self-table" @register="registerTable" @row-click="(record) => handleCheck(record)">
|
||||
<template #tableTitle>
|
||||
<span class="title-span">点击行添加到体检项中</span>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<div class="operation-box">
|
||||
<div v-if="checkList[record.id]" class="operation add-row">√</div>
|
||||
<div v-else class="operation elete-row"></div>
|
||||
</div>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<transfer-table
|
||||
ref="transferTableRef"
|
||||
:key="transferTableKey"
|
||||
:columns="TransferColumns"
|
||||
:dataSource="dataSource"
|
||||
class="transfer-table"
|
||||
@deleteItem="handleRemoveCheck"
|
||||
/>
|
||||
</div>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicTable } from '/@/components/Table';
|
||||
import { columns, searchFormSchema, TransferColumns } from './CheckPackageTable.data';
|
||||
import { selectHosList, saveSelectHosApi } from '../../HospitalDoctor.api';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import TransferTable from './TransferTable.vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
// Emits声明
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const title = ref('配置体检项');
|
||||
const hosId = ref();
|
||||
const doctorId = ref();
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
let { hospitalId, userId } = data.record;
|
||||
hosId.value = hospitalId;
|
||||
doctorId.value = userId;
|
||||
});
|
||||
//注册table数据
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
api: selectHosList,
|
||||
columns,
|
||||
canResize: false,
|
||||
formConfig: {
|
||||
labelAlign: 'right',
|
||||
// labelWidth: 100,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
labelCol: {
|
||||
style: '100px',
|
||||
},
|
||||
baseColProps: {
|
||||
xs: 8,
|
||||
sm: 8,
|
||||
md: 8,
|
||||
lg: 8,
|
||||
xl: 12,
|
||||
xxl: 8,
|
||||
},
|
||||
actionColOptions: {
|
||||
span: 24,
|
||||
offset: 0,
|
||||
xs: 8,
|
||||
sm: 8,
|
||||
md: 8,
|
||||
lg: 8,
|
||||
xl: 12,
|
||||
xxl: 8,
|
||||
},
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
params['hospitalId'] = hosId.value;
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
title: '选中',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, {}, {}] = tableContext;
|
||||
const transferTableRef = ref();
|
||||
const transferTableKey = ref(true);
|
||||
const dataSource = ref([]);
|
||||
const checkList = ref({});
|
||||
|
||||
function updateSource(res: []) {
|
||||
dataSource.value.push(...res);
|
||||
if (res) {
|
||||
res.map((item) => {
|
||||
checkList.value[item.checkItemId] = item;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 表单提交事件
|
||||
function clearDataSource() {
|
||||
dataSource.value = [];
|
||||
checkList.value = {};
|
||||
transferTableRef.value.updateDataSource([]);
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
clearDataSource();
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const selectIds = transferTableRef.value.emitDataSource();
|
||||
// if (selectIds === '') {
|
||||
// return message.warning('请选择体检配置项');
|
||||
// }
|
||||
const params = {
|
||||
...selectIds,
|
||||
doctorId: doctorId.value,
|
||||
};
|
||||
setModalProps({ confirmLoading: true });
|
||||
// 提交
|
||||
await saveSelectHosApi(params);
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
clearDataSource();
|
||||
//刷新列表
|
||||
emit('success');
|
||||
//关闭弹窗
|
||||
closeModal();
|
||||
}
|
||||
}
|
||||
|
||||
function handleCheck(record) {
|
||||
if (!checkList.value.hasOwnProperty(record.itemId)) {
|
||||
checkList.value[record.itemId] = record;
|
||||
(dataSource.value as any).push({
|
||||
...record,
|
||||
checkItemName: record.itemName,
|
||||
checkItemId: record.itemId,
|
||||
});
|
||||
} else {
|
||||
handleRemoveCheck({ ...record, checkItemId: record.itemId });
|
||||
}
|
||||
}
|
||||
|
||||
function handleRemoveCheck(record) {
|
||||
delete checkList.value[record.checkItemId];
|
||||
dataSource.value = dataSource.value.filter((item) => item.checkItemId !== record.checkItemId);
|
||||
transferTableRef.value.updateDataSource(dataSource.value);
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
updateSource,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.configuration-module {
|
||||
display: flex;
|
||||
height: 70vh;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
:deep(.ant-table-title) {
|
||||
//display: none;
|
||||
}
|
||||
|
||||
.self-table {
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.transfer-table {
|
||||
width: 30%;
|
||||
border: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
:deep(.add-row) {
|
||||
width: 100px;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #1890ff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
:deep(.delete-row) {
|
||||
width: 100px;
|
||||
//opacity: 0; cursor: pointer;
|
||||
}
|
||||
|
||||
.title-span {
|
||||
color: red;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.operation-box {
|
||||
margin-left: 40%;
|
||||
}
|
||||
|
||||
.operation {
|
||||
width: 21px;
|
||||
height: 21px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px solid #d9d9d9;
|
||||
}
|
||||
</style>
|
||||
@@ -1,69 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="panel-header">
|
||||
<p class="panel-title"> 体检项已选 </p>
|
||||
</div>
|
||||
<a-table :dataSource="transferState.dataSource" :columns="transferState.columns">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
<a @click="deleteItem(record)">删除</a>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ record[column.key] }}
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
columns: Array,
|
||||
dataSource: Array,
|
||||
});
|
||||
const emits = defineEmits(['deleteItem']);
|
||||
const transferState = ref({
|
||||
columns: props.columns,
|
||||
// dataSource: computed(() => props.dataSource),
|
||||
dataSource: props.dataSource,
|
||||
});
|
||||
|
||||
function updateDataSource(data) {
|
||||
transferState.value.dataSource = data;
|
||||
}
|
||||
|
||||
function emitDataSource() {
|
||||
return {
|
||||
selectIds: transferState.value.dataSource?.map((item) => item?.checkItemId).join(',') || '',
|
||||
};
|
||||
}
|
||||
|
||||
function deleteItem(record) {
|
||||
emits('deleteItem', record);
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
updateDataSource,
|
||||
emitDataSource,
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.panel-header {
|
||||
background-color: #fafafa;
|
||||
background-repeat: repeat-x;
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
padding: 0 15px;
|
||||
border-bottom: 1px solid #e7eaec !important;
|
||||
border-top-right-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
|
||||
.panel-title {
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -4,12 +4,8 @@ import { rules } from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { Component, h } from 'vue';
|
||||
import HealthUserEmployeeEx from './HealthUserEmployeeEx/HealthUserEmployeeExList.vue';
|
||||
import healthUserOperatorEx from './healthUserOperatorEx/HealthUserOperatorExList.vue';
|
||||
import healthUserStationEx from './healthUserStationEx/HealthUserStationExList.vue';
|
||||
import healthOperatorEx from './healthOperatorEx/healthOperatorExList.vue';
|
||||
import healthExpert from '/@/views/consult/doctor/message/conDoctorList.vue';
|
||||
import healthHelper from '/@/views/consult/helper/conHelperList.vue';
|
||||
import hospitalDoctor from './hospitalDoctor/HospitalDoctorList.vue';
|
||||
import { encipher } from '/@/utils/jsencrypt';
|
||||
import { checkPassword } from '/@/hooks/checkPassword/checkPassword';
|
||||
import { isShowIdCard } from '/@/utils/getEnv';
|
||||
@@ -674,30 +670,6 @@ export const typeList: UserType[] = [
|
||||
component: healthHelper,
|
||||
auth: 'system:consultation:con_helper:list',
|
||||
},
|
||||
{
|
||||
key: 4,
|
||||
title: '操作人员',
|
||||
component: healthOperatorEx,
|
||||
auth: 'system:health_operator_ex:list',
|
||||
},
|
||||
{
|
||||
key: 5,
|
||||
title: '专业人员',
|
||||
component: healthUserOperatorEx,
|
||||
auth: 'system:health_user_operator_ex:list',
|
||||
},
|
||||
// {
|
||||
// key: 6,
|
||||
// title: '驻场人员',
|
||||
// component: healthUserStationEx,
|
||||
// auth: 'system:health_user_station_ex:list',
|
||||
// },
|
||||
// {
|
||||
// key: 7,
|
||||
// title: '体检医院',
|
||||
// component: hospitalDoctor,
|
||||
// auth: 'medical:medical_hospital_user:list',
|
||||
// },
|
||||
];
|
||||
/**
|
||||
* @Description:处理请求参数
|
||||
|
||||
Reference in New Issue
Block a user