|
|
@@ -63,8 +63,12 @@ const IndicatorMana = () => {
|
|
|
});
|
|
|
const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
|
|
|
const [currentSelectedLeft, set_currentSelectedLeft] = useState<any>(undefined);
|
|
|
- const [actionType, set_actionType] = useState<'NORMAL' | 'DETAIL' | 'ANALYZE' | undefined>('NORMAL');
|
|
|
- const [drawerActype, set_drawerActype] = useState<'ADD' | 'EDIT' | 'DATAMANA' | undefined>(undefined);
|
|
|
+ const [actionType, set_actionType] = useState<'NORMAL' | 'DETAIL' | 'ANALYZE' | undefined>(
|
|
|
+ 'NORMAL'
|
|
|
+ );
|
|
|
+ const [drawerActype, set_drawerActype] = useState<'ADD' | 'EDIT' | 'DATAMANA' | undefined>(
|
|
|
+ undefined
|
|
|
+ );
|
|
|
const [tableDataSource, set_tableDataSource] = useState<any[]>([]);
|
|
|
const [currentYear, set_currentYear] = useState(defaultYear);
|
|
|
const [currentEditRow, set_currentEditRow] = useState<any>(undefined);
|
|
|
@@ -124,7 +128,7 @@ const IndicatorMana = () => {
|
|
|
if (parts.length < 2) return 0;
|
|
|
const nodeQuery = parseQuery(parts[1]);
|
|
|
let matched = 0;
|
|
|
- Object.keys(nodeQuery).forEach((k) => {
|
|
|
+ Object.keys(nodeQuery).forEach(k => {
|
|
|
if (currentQuery[k] !== undefined && currentQuery[k] === nodeQuery[k]) matched += 1;
|
|
|
});
|
|
|
return matched;
|
|
|
@@ -139,7 +143,8 @@ const IndicatorMana = () => {
|
|
|
} else if (s === bestScore) {
|
|
|
// 平分时,优先带有 function 的
|
|
|
const hasFuncBest = Array.isArray(best?.function) && best.function.length > 0;
|
|
|
- const hasFuncCurr = Array.isArray(candidates[i]?.function) && candidates[i].function.length > 0;
|
|
|
+ const hasFuncCurr =
|
|
|
+ Array.isArray(candidates[i]?.function) && candidates[i].function.length > 0;
|
|
|
if (!hasFuncBest && hasFuncCurr) best = candidates[i];
|
|
|
}
|
|
|
}
|
|
|
@@ -149,7 +154,7 @@ const IndicatorMana = () => {
|
|
|
if (selectedKeysStr) {
|
|
|
try {
|
|
|
const [selectedKey] = JSON.parse(selectedKeysStr) || [];
|
|
|
- const byKey = candidates.find((n) => String(n.key) === String(selectedKey));
|
|
|
+ const byKey = candidates.find(n => String(n.key) === String(selectedKey));
|
|
|
if (byKey) return byKey;
|
|
|
} catch (e) {}
|
|
|
}
|
|
|
@@ -162,7 +167,6 @@ const IndicatorMana = () => {
|
|
|
? ((node as any).function as any[]).map((i: any) => i?.code).filter(Boolean)
|
|
|
: [];
|
|
|
return codes.includes('report_manage');
|
|
|
-
|
|
|
}, [initialState?.menuData, location.pathname, (location as any).search]);
|
|
|
|
|
|
// 读取基础参数:userId、hospId(院区)
|
|
|
@@ -521,6 +525,7 @@ const IndicatorMana = () => {
|
|
|
drillLevel: formData.drillLevel ? formData.drillLevel.join('/') : '',
|
|
|
dataSum: formData.dataSum ? formData.dataSum.join('/') : '',
|
|
|
chartType: formData.chartType ? formData.chartType.join('/') : '',
|
|
|
+ divisionId: `${formData.divisionId}`,
|
|
|
});
|
|
|
if (resp) {
|
|
|
set_drawerVisible(false);
|
|
|
@@ -684,7 +689,7 @@ const IndicatorMana = () => {
|
|
|
analysisReportCode: values.reportId,
|
|
|
analysisReportParam: finalParamStr,
|
|
|
}));
|
|
|
- set_reportReloadKey((k) => k + 1);
|
|
|
+ set_reportReloadKey(k => k + 1);
|
|
|
return true;
|
|
|
}
|
|
|
} else if (isDetailOnline) {
|
|
|
@@ -702,7 +707,7 @@ const IndicatorMana = () => {
|
|
|
onlineReportCode: values.reportId,
|
|
|
onlineReportParam: finalParamStr,
|
|
|
}));
|
|
|
- set_reportReloadKey((k) => k + 1);
|
|
|
+ set_reportReloadKey(k => k + 1);
|
|
|
return true;
|
|
|
}
|
|
|
} else {
|
|
|
@@ -738,37 +743,36 @@ const IndicatorMana = () => {
|
|
|
onFinish={handleReportSubmit}
|
|
|
width={500}
|
|
|
initialValues={
|
|
|
- currentEditRow && (
|
|
|
- actionType === 'ANALYZE'
|
|
|
- ? {
|
|
|
- reportId: currentEditRow.analysisReportCode,
|
|
|
- remark: currentEditRow.analysisRemark,
|
|
|
- analysisReportParam: (() => {
|
|
|
- try {
|
|
|
- const txt = currentEditRow.analysisReportParam;
|
|
|
- if (!txt || String(txt).trim().length === 0) return '{}';
|
|
|
- const obj = JSON.parse(String(txt));
|
|
|
- return JSON.stringify(obj, null, 2);
|
|
|
- } catch (e) {
|
|
|
- return String(currentEditRow.analysisReportParam || '{}');
|
|
|
- }
|
|
|
- })(),
|
|
|
- }
|
|
|
- : {
|
|
|
- reportId: currentEditRow.onlineReportCode,
|
|
|
- remark: currentEditRow.onlineRemark,
|
|
|
- onlineReportParam: (() => {
|
|
|
- try {
|
|
|
- const txt = currentEditRow.onlineReportParam;
|
|
|
- if (!txt || String(txt).trim().length === 0) return '{}';
|
|
|
- const obj = JSON.parse(String(txt));
|
|
|
- return JSON.stringify(obj, null, 2);
|
|
|
- } catch (e) {
|
|
|
- return String(currentEditRow.onlineReportParam || '{}');
|
|
|
- }
|
|
|
- })(),
|
|
|
- }
|
|
|
- )
|
|
|
+ currentEditRow &&
|
|
|
+ (actionType === 'ANALYZE'
|
|
|
+ ? {
|
|
|
+ reportId: currentEditRow.analysisReportCode,
|
|
|
+ remark: currentEditRow.analysisRemark,
|
|
|
+ analysisReportParam: (() => {
|
|
|
+ try {
|
|
|
+ const txt = currentEditRow.analysisReportParam;
|
|
|
+ if (!txt || String(txt).trim().length === 0) return '{}';
|
|
|
+ const obj = JSON.parse(String(txt));
|
|
|
+ return JSON.stringify(obj, null, 2);
|
|
|
+ } catch (e) {
|
|
|
+ return String(currentEditRow.analysisReportParam || '{}');
|
|
|
+ }
|
|
|
+ })(),
|
|
|
+ }
|
|
|
+ : {
|
|
|
+ reportId: currentEditRow.onlineReportCode,
|
|
|
+ remark: currentEditRow.onlineRemark,
|
|
|
+ onlineReportParam: (() => {
|
|
|
+ try {
|
|
|
+ const txt = currentEditRow.onlineReportParam;
|
|
|
+ if (!txt || String(txt).trim().length === 0) return '{}';
|
|
|
+ const obj = JSON.parse(String(txt));
|
|
|
+ return JSON.stringify(obj, null, 2);
|
|
|
+ } catch (e) {
|
|
|
+ return String(currentEditRow.onlineReportParam || '{}');
|
|
|
+ }
|
|
|
+ })(),
|
|
|
+ })
|
|
|
}
|
|
|
formRef={reportForm}
|
|
|
modalProps={{
|
|
|
@@ -850,18 +854,22 @@ const IndicatorMana = () => {
|
|
|
<div className="currentBigTab1content_header">
|
|
|
<span>{currentEditRow?.onlineRemark}</span>
|
|
|
{canManageReport && (
|
|
|
- <div className='btn' onClick={openReportModal}>
|
|
|
- <IconFont type='iconpeizhi' /> 报告管理
|
|
|
+ <div className="btn" onClick={openReportModal}>
|
|
|
+ <IconFont type="iconpeizhi" /> 报告管理
|
|
|
</div>
|
|
|
)}
|
|
|
</div>
|
|
|
- {(currentEditRow && currentEditRow.onlineReportCode) && (
|
|
|
+ {currentEditRow && currentEditRow.onlineReportCode && (
|
|
|
<FrameComponent
|
|
|
- link={`/platform/setting/embeddedDashboard/${currentEditRow.onlineReportCode}?noTopbar=true&noMenu=true&reload=${reportReloadKey}&urlParams=${encodeURIComponent(
|
|
|
+ link={`/platform/setting/embeddedDashboard/${
|
|
|
+ currentEditRow.onlineReportCode
|
|
|
+ }?noTopbar=true&noMenu=true&reload=${reportReloadKey}&urlParams=${encodeURIComponent(
|
|
|
(() => {
|
|
|
try {
|
|
|
const base = withBaseParams({});
|
|
|
- const raw = currentEditRow?.onlineReportParam ? JSON.parse(currentEditRow.onlineReportParam) : {};
|
|
|
+ const raw = currentEditRow?.onlineReportParam
|
|
|
+ ? JSON.parse(currentEditRow.onlineReportParam)
|
|
|
+ : {};
|
|
|
return JSON.stringify({ ...base, ...raw });
|
|
|
} catch {
|
|
|
return JSON.stringify(withBaseParams({}));
|
|
|
@@ -957,8 +965,8 @@ const IndicatorMana = () => {
|
|
|
</div>
|
|
|
<span>{currentEditRow?.name}</span>
|
|
|
{canManageReport && (
|
|
|
- <div className='btn' onClick={openReportModal} style={{ marginLeft: 'auto' }}>
|
|
|
- <IconFont type='iconpeizhi' /> 报告管理
|
|
|
+ <div className="btn" onClick={openReportModal} style={{ marginLeft: 'auto' }}>
|
|
|
+ <IconFont type="iconpeizhi" /> 报告管理
|
|
|
</div>
|
|
|
)}
|
|
|
</div>
|
|
|
@@ -968,13 +976,17 @@ const IndicatorMana = () => {
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="currentBigTab1content">
|
|
|
- {(currentEditRow && currentEditRow.analysisReportCode) && (
|
|
|
+ {currentEditRow && currentEditRow.analysisReportCode && (
|
|
|
<FrameComponent
|
|
|
- link={`/platform/setting/embeddedDashboard/${currentEditRow.analysisReportCode}?noTopbar=true&noMenu=true&reload=${reportReloadKey}&urlParams=${encodeURIComponent(
|
|
|
+ link={`/platform/setting/embeddedDashboard/${
|
|
|
+ currentEditRow.analysisReportCode
|
|
|
+ }?noTopbar=true&noMenu=true&reload=${reportReloadKey}&urlParams=${encodeURIComponent(
|
|
|
(() => {
|
|
|
try {
|
|
|
const base = withBaseParams({});
|
|
|
- const raw = currentEditRow?.analysisReportParam ? JSON.parse(currentEditRow.analysisReportParam) : {};
|
|
|
+ const raw = currentEditRow?.analysisReportParam
|
|
|
+ ? JSON.parse(currentEditRow.analysisReportParam)
|
|
|
+ : {};
|
|
|
return JSON.stringify({ ...base, ...raw });
|
|
|
} catch {
|
|
|
return JSON.stringify(withBaseParams({}));
|