index.tsx 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. /*
  2. * @Author: code4eat awesomedema@gmail.com
  3. * @Date: 2023-03-03 11:30:33
  4. * @LastEditors: code4eat awesomedema@gmail.com
  5. * @LastEditTime: 2025-08-08 14:20:50
  6. * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  7. * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  8. */
  9. import KCIMPagecontainer from '@/components/KCIMPageContainer';
  10. import { KCIMTable } from '@/components/KCIMTable';
  11. import { createFromIconfontCN } from '@ant-design/icons';
  12. import { ActionType, arrayMoveImmutable, ProFormText, ProFormTextArea, useRefFunction } from '@ant-design/pro-components';
  13. import { ModalForm, ProFormCascader, ProFormCheckbox, ProFormDateRangePicker, ProFormDependency, ProFormDigit, ProFormRadio, ProFormSelect, ProFormSwitch } from '@ant-design/pro-form'
  14. import { ProColumns } from '@ant-design/pro-table';
  15. import { Drawer, Input, message, Popconfirm, Popover, Switch } from 'antd';
  16. import { Fragment, Key, useEffect, useRef, useState } from 'react';
  17. import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc';
  18. import { editData, getTableDataReq, reAuthData, getQualificationApplyList } from './service';
  19. import './style.less';
  20. import { KCIMLeftList } from '@/components/KCIMLeftList';
  21. import { getTableList as getQualClassReq } from '../qualificationClassfiMana/service';
  22. import { getDicDataBySysId } from '@/services/getDic';
  23. import { authTimeType, KcimCenterSysId } from '@/constant';
  24. import TableTransfer from './transform';
  25. import React from 'react';
  26. import 'moment/locale/zh-cn';
  27. import moment from 'moment';
  28. import AuthHisContent from './authHisttory';
  29. import { useAccess } from '@umijs/max';
  30. const IconFont = createFromIconfontCN({
  31. scriptUrl: '',
  32. });
  33. export default function QualificationAuth({ isChildComponent = false, qualifiCode, onTableSelectChange, defaultSelectedKeys }: {
  34. isChildComponent: boolean, qualifiCode: string, onTableSelectChange?: (selectedRowKeys: any[], selectedRows: any[], info: any) => void,
  35. defaultSelectedKeys?: Key[]
  36. }) {
  37. const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
  38. const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
  39. const [dataSource, set_dataSource] = useState<any[]>([]);
  40. const SortableItem = SortableElement((props: any) => <tr {...props} />);
  41. const SortContainer = SortableContainer((props: any) => <tbody {...props} />);
  42. const [currentSelectedType, set_currentSelectedType] = useState<any | undefined>(undefined);
  43. const [operationLevel, set_operationLevel] = useState<any[]>([]);
  44. const [drawerVisible, set_drawerVisible] = useState(false);
  45. const [currentEditRow, set_currentEditRow] = useState<any>(undefined);
  46. const [currentPageTableData,set_currentPageTableData] = useState<any[]>([]);
  47. const [drawerTableLoading, set_drawerTableLoading] = useState(false);
  48. const access = useAccess();
  49. const tabs = access.whatCanIDoInThisPage(location.pathname.replace('/MediResourceManaSys', ''));
  50. const a = tabs.reduce((prev: any, cur: any) => `${prev},${cur.code}`, '');
  51. const tableRef = useRef<ActionType>();
  52. const drawerTableRef = useRef<ActionType>();
  53. const [drawerTableData, set_drawerTableData] = useState<any[]>([]);
  54. const columns: ProColumns[] = [
  55. {
  56. title: '资质编码',
  57. width: 150,
  58. ellipsis: true,
  59. renderText(text, record, index, action) {
  60. const { qualification: { code } } = record;
  61. return code
  62. },
  63. },
  64. {
  65. title: '资质名称',
  66. ellipsis: true,
  67. renderText(text, record, index, action) {
  68. const { qualification: { name } } = record;
  69. return name
  70. },
  71. },
  72. {
  73. title: '资质分类',
  74. ellipsis: true,
  75. renderText(text, record, index, action) {
  76. const { qualification: { qualificationTypeName } } = record;
  77. return qualificationTypeName
  78. },
  79. },
  80. {
  81. title: '特殊类别',
  82. ellipsis: true,
  83. width: 150,
  84. renderText(text, record, index, action) {
  85. const { operationFlag, techFlag, operationLevelCode } = record;
  86. return <div>
  87. {
  88. techFlag == 1 && (
  89. <span style={{
  90. display: 'inline-flex', width: 64, height: 20, justifyContent: 'center',
  91. alignItems: 'center', background: '#FFF5EB', borderRadius: 4, fontSize: 12, color: '#FF8000', marginRight: 4
  92. }}>医疗技术</span>
  93. )
  94. }
  95. {
  96. operationFlag == 1 && (
  97. <span style={{
  98. display: 'inline-flex', width: 64, height: 20, justifyContent: 'center',
  99. alignItems: 'center', background: '#E8FCF6', borderRadius: 4, fontSize: 12, color: '#009966'
  100. }}>{
  101. (operationLevel.filter((a) => a.value == operationLevelCode))[0].name
  102. }</span>
  103. )
  104. }
  105. {
  106. (!operationFlag && !techFlag) && (<Fragment/>)
  107. }
  108. </div>
  109. },
  110. },
  111. {
  112. title: '操作',
  113. key: 'option',
  114. width: 60,
  115. fixed: 'right',
  116. valueType: 'option',
  117. render: (_: any, record: any) => {
  118. return [
  119. <a key={'detailBtn'} onClick={() => {
  120. set_currentEditRow(record);
  121. set_drawerVisible(true);
  122. }}>详情</a>
  123. ]
  124. },
  125. },
  126. ];
  127. const drawerTablecolumns: ProColumns[] = [
  128. {
  129. title: '姓名',
  130. width: 70,
  131. ellipsis: true,
  132. renderText(text, record, index, action) {
  133. const { userInfo: { name } } = record;
  134. return name;
  135. },
  136. },
  137. {
  138. title: '工号',
  139. ellipsis: true,
  140. renderText(text, record, index, action) {
  141. const { userInfo: { account } } = record;
  142. return account;
  143. },
  144. },
  145. {
  146. title: '所在科室',
  147. ellipsis: true,
  148. renderText(text, record, index, action) {
  149. const { userInfo: { deptName } } = record;
  150. return deptName;
  151. },
  152. },
  153. {
  154. title: '职称',
  155. ellipsis: true,
  156. renderText(text, record, index, action) {
  157. const { userInfo: { jobTitle } } = record;
  158. return jobTitle;
  159. },
  160. },
  161. {
  162. title: '授权期限',
  163. ellipsis: true,
  164. renderText(text, record, index, action) {
  165. const { qualificationPeriod } = record;
  166. if (qualificationPeriod == 1) {
  167. return '长期授权'
  168. }
  169. if (qualificationPeriod == 2) {
  170. return '临时授权'
  171. }
  172. if (qualificationPeriod == 3) {
  173. return '单次授权'
  174. }
  175. },
  176. },
  177. {
  178. title: '授权时间',
  179. width: 260,
  180. ellipsis: true,
  181. renderText(text, record, index, action) {
  182. const { beginDate, endDate, applyAdjust } = record;
  183. const content = <AuthHisContent hisList={applyAdjust ? [...applyAdjust] : []} />
  184. return <>{`${beginDate}至${endDate}`}
  185. {applyAdjust && applyAdjust.length > 0 && (
  186. <Popover className='qualificationAuth-popover' overlayInnerStyle={{borderRadius:4}} content={content} title={false} >
  187. <IconFont type={'icon-qingliangtishi'} style={{marginLeft:10,cursor:'pointer' }} />
  188. </Popover>
  189. )}</>;
  190. },
  191. },
  192. {
  193. title: '当前状态',
  194. ellipsis: true,
  195. dataIndex: 'currentStatus',
  196. renderText(text, record, index, action) {
  197. if (text == '授权中') {
  198. return <><span style={{ display: 'inline-block', width: 8, height: 8, borderRadius: '50%', marginRight: 4, background: '#FFB54D' }}></span>{text}</>
  199. }
  200. if (text == '已过期') {
  201. return <><span style={{ display: 'inline-block', width: 8, height: 8, borderRadius: '50%', marginRight: 4, background: '#FF4D6A' }}></span>{text}</>
  202. }
  203. },
  204. },
  205. {
  206. title: '操作',
  207. key: 'option',
  208. hideInTable:a.indexOf('medical-adjust') == -1,
  209. width: 100,
  210. fixed: 'right',
  211. valueType: 'option',
  212. render: (_: any, record: any) => {
  213. const {currentStatus,allowReAuthorize} = record;
  214. return [
  215. currentStatus == '授权中'?<UpDataActBtn key={'act'} record={record} type='EDIT' />:allowReAuthorize == 1&&<UpDataActBtn key={'act'} record={record} type='AUTH' />,
  216. ]
  217. },
  218. },
  219. ]
  220. const getTableData = async (params: any) => {
  221. const { qualificationTypeCode } = params;
  222. if (!qualificationTypeCode) {
  223. }
  224. console.log('params',params);
  225. const resp = await getTableDataReq(params);
  226. if (resp) {
  227. const data = (resp.list).map((a: any, index: number) => ({ id: index, ...a }));
  228. set_currentPageTableData(data);
  229. return {
  230. data,
  231. success: true,
  232. total: resp.totalCount || 0,
  233. current: resp.current || 1,
  234. pageSize: resp.pageSize || 10
  235. }
  236. } else {
  237. return {
  238. data: [],
  239. success: false,
  240. total: 0,
  241. current: 1,
  242. pageSize: 10
  243. }
  244. }
  245. }
  246. const updateTable = async (formVal: any, type: 'EDIT' | 'AUTH') => {
  247. try {
  248. if (type == 'EDIT') {
  249. const resp = await editData({
  250. qualificationApplyId: formVal.id, // 新接口返回的数据中有id字段
  251. qualificationPeriod: Number(formVal.qualificationPeriod),
  252. beginDate: formVal.timerange[0],
  253. endDate: formVal.timerange[1],
  254. memo: formVal.memo
  255. });
  256. if (resp) {
  257. // 重新获取抽屉表格数据
  258. if (currentEditRow?.qualification?.code) {
  259. set_drawerTableLoading(true);
  260. const applyListResp = await getQualificationApplyList(currentEditRow.qualification.code);
  261. // 检查不同的数据结构可能性
  262. let dataList = [];
  263. if (applyListResp && applyListResp.list) {
  264. dataList = applyListResp.list;
  265. } else if (applyListResp && Array.isArray(applyListResp)) {
  266. dataList = applyListResp;
  267. } else if (applyListResp && applyListResp.data) {
  268. dataList = applyListResp.data;
  269. }
  270. set_drawerTableData(dataList);
  271. // 强制刷新表格
  272. if (drawerTableRef.current) {
  273. drawerTableRef.current.reload();
  274. }
  275. set_drawerTableLoading(false);
  276. }
  277. message.success('操作成功!');
  278. }
  279. } else {
  280. const resp = await reAuthData({
  281. qualificationApplyId: formVal.id, // 新接口返回的数据中有id字段
  282. qualificationPeriod: Number(formVal.qualificationPeriod),
  283. beginDate: formVal.timerange[0],
  284. endDate: formVal.timerange[1],
  285. memo: formVal.memo
  286. });
  287. if (resp) {
  288. // 重新获取抽屉表格数据
  289. if (currentEditRow?.qualification?.code) {
  290. set_drawerTableLoading(true);
  291. const applyListResp = await getQualificationApplyList(currentEditRow.qualification.code);
  292. // 检查不同的数据结构可能性
  293. let dataList = [];
  294. if (applyListResp && applyListResp.list) {
  295. dataList = applyListResp.list;
  296. } else if (applyListResp && Array.isArray(applyListResp)) {
  297. dataList = applyListResp;
  298. } else if (applyListResp && applyListResp.data) {
  299. dataList = applyListResp.data;
  300. }
  301. set_drawerTableData(dataList);
  302. // 强制刷新表格
  303. if (drawerTableRef.current) {
  304. drawerTableRef.current.reload();
  305. }
  306. set_drawerTableLoading(false);
  307. }
  308. message.success('操作成功!');
  309. }
  310. }
  311. return true;
  312. } catch (error) {
  313. console.log({ error });
  314. return false;
  315. }
  316. }
  317. const formRef = useRef();
  318. const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'AUTH' }) => {
  319. const ref = React.createRef<{ save: any; }>();
  320. return (
  321. <ModalForm
  322. title={type == 'EDIT' ? '调整授权' : '重新授权'}
  323. width={352}
  324. formRef={formRef}
  325. initialValues={{
  326. qualificationPeriod: record.qualificationPeriod || 1,
  327. timerange: record.beginDate && record.endDate ? [moment(record.beginDate), moment(record.endDate)] : [moment().startOf("day"), moment().startOf("day")],
  328. memo: record.applyMemo || ''
  329. }}
  330. trigger={
  331. type == 'EDIT' ? <a key="edit" >调整</a> : <a className='auth'>重新授权</a>
  332. }
  333. onFinish={(val) => {
  334. return updateTable(type == 'EDIT' ? { ...record, ...val } : {...record, ...val }, type);
  335. }}
  336. modalProps={{ destroyOnClose: true }}
  337. colProps={{ span: 24 }}
  338. grid
  339. >
  340. <ProFormRadio.Group label='授权期限:' name={'qualificationPeriod'} options={authTimeType} />
  341. <ProFormDateRangePicker label='授权时间:' name='timerange' />
  342. <ProFormTextArea label='调整原因:' name={'memo'} />
  343. </ModalForm>
  344. )
  345. }
  346. const tableDataSearchHandle = (key: string) => {
  347. // 搜索时需要重置到第1页
  348. set_tableDataFilterParams({ ...tableDataFilterParams, [key]: tableDataSearchKeywords, _searchTrigger: Date.now() })
  349. }
  350. const getQualClassRequest = async () => {
  351. const resp = await getQualClassReq();
  352. if (true) {
  353. set_dataSource(resp);
  354. }
  355. }
  356. const updateTableSortHandle = async (data: any[]) => {
  357. }
  358. const onSortEnd = useRefFunction(
  359. ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {
  360. if (oldIndex !== newIndex) {
  361. const newData = arrayMoveImmutable({
  362. array: [...dataSource],
  363. fromIndex: oldIndex,
  364. toIndex: newIndex,
  365. }).filter((el) => !!el);
  366. const updatedSortArr = newData.map((item: any, index: number) => ({ ...item, sort: index + 1 }));
  367. set_dataSource([...updatedSortArr]);
  368. updateTableSortHandle(updatedSortArr);
  369. }
  370. },
  371. );
  372. const DraggableContainer = (props: any) => (
  373. <SortContainer
  374. useDragHandle
  375. disableAutoscroll
  376. helperClass="row-dragging"
  377. onSortEnd={onSortEnd}
  378. {...props}
  379. />
  380. );
  381. const DraggableBodyRow = (props: any) => {
  382. const { className, style, ...restProps } = props;
  383. // function findIndex base on Table rowKey props and should always be a right array index
  384. const index = dataSource.findIndex((x) => x.id === restProps['data-row-key']);
  385. return <SortableItem index={index} {...restProps} />;
  386. };
  387. useEffect(() => {
  388. if (currentSelectedType && !isChildComponent) {
  389. // getTableData({ qualificationTypeCode: currentSelectedType.code });
  390. // 分类变化时需要重置到第1页
  391. set_tableDataFilterParams({ ...tableDataFilterParams, qualificationTypeCode: currentSelectedType.code, _categoryTrigger: Date.now() })
  392. }
  393. }, [currentSelectedType]);
  394. useEffect(() => {
  395. if (isChildComponent && qualifiCode) {
  396. set_currentSelectedType(true);
  397. set_tableDataFilterParams({ ...tableDataFilterParams, qualificationTypeCode: qualifiCode })
  398. }
  399. }, [qualifiCode]);
  400. useEffect(() => {
  401. if (currentEditRow) {
  402. // 通过新接口获取授权申请列表
  403. const fetchApplyList = async () => {
  404. try {
  405. set_drawerTableLoading(true);
  406. const qualificationCode = currentEditRow.qualification?.code;
  407. if (qualificationCode) {
  408. const resp = await getQualificationApplyList(qualificationCode);
  409. // 检查不同的数据结构可能性
  410. let dataList = [];
  411. if (resp && resp.list) {
  412. dataList = resp.list;
  413. } else if (resp && Array.isArray(resp)) {
  414. dataList = resp;
  415. } else if (resp && resp.data) {
  416. dataList = resp.data;
  417. }
  418. set_drawerTableData(dataList);
  419. } else {
  420. set_drawerTableData([]);
  421. }
  422. } catch (error) {
  423. console.error('获取授权申请列表失败:', error);
  424. set_drawerTableData([]);
  425. } finally {
  426. set_drawerTableLoading(false);
  427. }
  428. };
  429. fetchApplyList();
  430. }
  431. }, [currentEditRow]);
  432. useEffect(()=>{
  433. if(currentPageTableData&&drawerVisible){
  434. const needitem = currentPageTableData.filter((a)=>a.qualification.id == currentEditRow.qualification.id);
  435. if(needitem.length>0){
  436. set_currentEditRow(needitem[0]);
  437. }
  438. }
  439. },[currentPageTableData])
  440. useEffect(() => {
  441. if (!isChildComponent) {
  442. getQualClassRequest();
  443. }
  444. }, [])
  445. return (
  446. <KCIMPagecontainer className='QualificationAuth' style={!isChildComponent ? {} : { border: 'none' }} title={false}>
  447. <Drawer destroyOnClose={true} className='qualificationAuth-authDetailDrawer' width={1100}
  448. open={drawerVisible} headerStyle={{ display: 'none' }} bodyStyle={{ background: '#F5F7FA', padding: 16 }}
  449. >
  450. <div className='authDetailDrawer-topBar'>
  451. <div className='authDetailDrawer-topBar-title'>
  452. <div className='closeIcon' onClick={() => set_drawerVisible(false)}><IconFont type={'iconquxiao'} /></div>{'授权详情'}
  453. </div>
  454. {/* <div className='btnGroup'>
  455. <span onClick={() => set_drawerVisible(false)}>取消</span>
  456. <span className='reject' onClick={() => updateTable(2)}>驳回</span>
  457. <span className='commit' onClick={() => updateTable(1)}>通过</span>
  458. </div> */}
  459. </div>
  460. <div className='authDetailDrawer-content'>
  461. <div className='authDetailDrawer-info'>
  462. <div className='authDetailDrawer-info-title'>
  463. {currentEditRow?.qualification?.name}
  464. {
  465. currentEditRow?.qualification?.techFlag == 1 && (
  466. <span style={{
  467. display: 'inline-flex', height: 20, justifyContent: 'center', marginLeft: 8, padding: '0 12px',
  468. alignItems: 'center', background: '#FFF5EB', borderRadius: 4, fontSize: 12, color: '#FF8000', marginRight: 4
  469. }}>医疗技术</span>
  470. )
  471. }
  472. {
  473. currentEditRow?.qualification?.operationFlag == 1 && (
  474. <span style={{
  475. display: 'inline-flex', height: 20, justifyContent: 'center', padding: '0 12px', marginLeft: 8,
  476. alignItems: 'center', background: '#E8FCF6', borderRadius: 4, fontSize: 12, color: '#009966'
  477. }}>{
  478. ((operationLevel.filter((a) => a.value == currentEditRow?.qualification?.operationLevelCode))).length > 0 ? ((operationLevel.filter((a) => a.value == currentEditRow?.qualification?.operationLevelCode)))[0].name : ''
  479. }</span>
  480. )
  481. }
  482. </div>
  483. <div className='authDetailDrawer-info-title-sub'>
  484. 资质编码:{currentEditRow?.qualification?.code}<span style={{ padding: '0 8px' }}></span>
  485. 资质分类:{currentEditRow?.qualification?.qualificationTypeName}
  486. {currentEditRow?.qualification?.standard.length > 0 && (
  487. <div className='authDetailDrawer-info-standard'>
  488. {currentEditRow.qualification.standard}
  489. <img src={require('../../../../static/shouquanyiju.png')} alt="" />
  490. </div>
  491. )}
  492. </div>
  493. </div>
  494. <div className='authDetailDrawer-content-table'>
  495. <div className='authDetailDrawer-content-table-title'>授权信息</div>
  496. <KCIMTable
  497. key={`drawer-table-${drawerTableData.length}`}
  498. actionRef={drawerTableRef} columns={drawerTablecolumns as ProColumns[]} rowKey='id'
  499. // request={(params) => getTableData(params)}
  500. dataSource={drawerTableData}
  501. tableAlertRender={false}
  502. scroll={{ y: 545 }}
  503. loading={drawerTableLoading}
  504. />
  505. </div>
  506. </div>
  507. </Drawer>
  508. <div className='pageContent'>
  509. {
  510. !isChildComponent && (
  511. <div className='left'>
  512. <KCIMLeftList searchKey={'name'} dataSource={dataSource} fieldNames={{ title: 'name', key: 'code' }}
  513. defaultSelectType='node'
  514. listType='tree' onChange={(val) => set_currentSelectedType(val)} />
  515. </div>
  516. )
  517. }
  518. <div className='right' style={isChildComponent ? { width: '100%' } : { width: 'calc(100% - 236px)', padding: 16 }}>
  519. <div className='toolBar'>
  520. <div className='filter'>
  521. <div className='filterItem'>
  522. <span className='label'>手术级别:</span>
  523. <ProFormSelect noStyle
  524. style={{ width: 160, marginRight: 16 }}
  525. placeholder={'请选择'}
  526. request={async () => {
  527. const resp = await getDicDataBySysId(KcimCenterSysId, 'SURGICAL_AND_OPERATIONAL_LEVELS');
  528. if (resp) {
  529. set_operationLevel(resp.dataVoList);
  530. return resp.dataVoList.map((item: any) => ({ label: item.name, value: item.value }))
  531. }
  532. }}
  533. fieldProps={{
  534. onChange(value, option) {
  535. // 筛选条件变化时需要重置到第1页
  536. set_tableDataFilterParams({ ...tableDataFilterParams, operationLevelCode: value, _levelTrigger: Date.now() })
  537. },
  538. }}
  539. />
  540. </div>
  541. <div className='filterItem'>
  542. <span className='label'>检索:</span>
  543. <Input placeholder={'资质名称'} style={{ width: 160, marginRight: 16 }} allowClear autoComplete='off'
  544. suffix={
  545. <IconFont style={{ color: '#99A6BF' }} type="iconsousuo" onClick={() => tableDataSearchHandle('name')} />
  546. }
  547. onChange={(e) => {
  548. set_tableDataSearchKeywords(e.target.value);
  549. if (e.target.value.length == 0) {
  550. set_tableDataSearchKeywords('');
  551. set_tableDataFilterParams({...tableDataFilterParams,name:undefined})
  552. }
  553. }}
  554. onPressEnter={(e) => {
  555. tableDataSearchHandle('name')
  556. }}
  557. />
  558. </div>
  559. <div className='filterItem'>
  560. <ProFormCheckbox.Group
  561. name="checkbox"
  562. layout='horizontal'
  563. noStyle
  564. options={['医疗技术', '手术']}
  565. fieldProps={{
  566. onChange(checkedValue) {
  567. // 筛选条件变化时需要重置到第1页
  568. set_tableDataFilterParams({
  569. ...tableDataFilterParams,
  570. techFlag: checkedValue.findIndex((a) => a == '医疗技术') != -1 ? 1 : 0,
  571. operationFlag: checkedValue.findIndex((a) => a == '手术') != -1 ? 1 : 0,
  572. _checkboxTrigger: Date.now()
  573. // enableFlag: checkedValue.findIndex((a) => a == '已停用') != -1 ? 0 : 1,
  574. })
  575. },
  576. }}
  577. />
  578. </div>
  579. </div>
  580. {/* {!isChildComponent && (
  581. <div className='btnGroup'>
  582. <UpDataActBtn record type='ADD' />
  583. </div>
  584. )} */}
  585. </div>
  586. <div style={{ marginTop: 16 }}>
  587. {currentSelectedType && <KCIMTable scroll={{ y: `calc(100vh - 230px)` }}
  588. actionRef={tableRef} columns={columns as ProColumns[]} rowKey='id'
  589. params={tableDataFilterParams}
  590. request={(params) => getTableData(params)}
  591. // dataSource={showList}
  592. tableAlertRender={false}
  593. rowSelection={isChildComponent ? {
  594. defaultSelectedRowKeys: defaultSelectedKeys,
  595. onChange(selectedRowKeys, selectedRows, info) {
  596. onTableSelectChange && onTableSelectChange(selectedRowKeys, selectedRows, info)
  597. },
  598. } : false}
  599. components={{
  600. body: {
  601. wrapper: DraggableContainer,
  602. row: DraggableBodyRow,
  603. },
  604. }}
  605. />}
  606. </div>
  607. </div>
  608. </div>
  609. </KCIMPagecontainer>
  610. )
  611. }