64 lines
1.7 KiB
TypeScript
64 lines
1.7 KiB
TypeScript
import {useState} from "react";
|
|
import Taro, {useDidShow} from '@tarojs/taro'
|
|
import {Button, Cell, CellGroup, Space, Empty, ConfigProvider, Divider} from '@nutui/nutui-react-taro'
|
|
import {Dongdong, ArrowRight, CheckNormal, Checked} from '@nutui/icons-react-taro'
|
|
import {View} from '@tarojs/components'
|
|
import {ClinicDoctorUser} from "@/api/clinic/clinicDoctorUser/model";
|
|
import {listClinicDoctorUser, removeClinicDoctorUser, updateClinicDoctorUser} from "@/api/clinic/clinicDoctorUser";
|
|
|
|
const ClinicDoctorUserList = () => {
|
|
const [list, setList] = useState<ClinicDoctorUser[]>([])
|
|
|
|
const reload = () => {
|
|
listClinicDoctorUser({
|
|
// 添加查询条件
|
|
})
|
|
.then(data => {
|
|
setList(data || [])
|
|
})
|
|
.catch(() => {
|
|
Taro.showToast({
|
|
title: '获取数据失败',
|
|
icon: 'error'
|
|
});
|
|
})
|
|
}
|
|
|
|
|
|
const onDel = async (id?: number) => {
|
|
await removeClinicDoctorUser(id)
|
|
Taro.showToast({
|
|
title: '删除成功',
|
|
icon: 'success'
|
|
});
|
|
reload();
|
|
}
|
|
|
|
useDidShow(() => {
|
|
reload()
|
|
});
|
|
|
|
if (list.length == 0) {
|
|
return (
|
|
<ConfigProvider>
|
|
<div className={'h-full flex flex-col justify-center items-center'} style={{
|
|
height: 'calc(100vh - 300px)',
|
|
}}>
|
|
<Empty
|
|
style={{
|
|
backgroundColor: 'transparent'
|
|
}}
|
|
description="暂无数据"
|
|
/>
|
|
<Space>
|
|
<Button onClick={() => Taro.navigateTo({url: '/clinic/clinicDoctorUser/add'})}>新增分销商用户记录表</Button>
|
|
</Space>
|
|
</div>
|
|
</ConfigProvider>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<>
|
|
{list.map((item, _) => (
|
|
<Cell.Group key={item. |