@hkyhy/marsun-components-core 0.1.118 → 0.1.120

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/dist/components/Audit/AuditLogList.d.ts +4 -0
  2. package/dist/components/Audit/AuditLogList.js +168 -166
  3. package/dist/components/Audit/AuditLogList.js.map +1 -1
  4. package/dist/components/Audit/AuditStepPerfChart.d.ts +10 -0
  5. package/dist/components/Audit/AuditStepPerfChart.js +51 -0
  6. package/dist/components/Audit/AuditStepPerfChart.js.map +1 -0
  7. package/dist/components/Audit/AuditWaterfall.d.ts +5 -1
  8. package/dist/components/Audit/AuditWaterfall.js +50 -34
  9. package/dist/components/Audit/AuditWaterfall.js.map +1 -1
  10. package/dist/components/Audit/Chart/createLazyPlot.d.ts +4 -0
  11. package/dist/components/Audit/Chart/createLazyPlot.js +12 -11
  12. package/dist/components/Audit/Chart/createLazyPlot.js.map +1 -1
  13. package/dist/components/Audit/detailKpi.d.ts +8 -3
  14. package/dist/components/Audit/detailKpi.js +28 -20
  15. package/dist/components/Audit/detailKpi.js.map +1 -1
  16. package/dist/components/Audit/index.d.ts +4 -2
  17. package/dist/components/Audit/style.module.scss.js +48 -28
  18. package/dist/components/Audit/style.module.scss.js.map +1 -1
  19. package/dist/components/Filter/createKneFilterField.js +55 -53
  20. package/dist/components/Filter/createKneFilterField.js.map +1 -1
  21. package/dist/components/Form/SuperSelect.d.ts +1 -0
  22. package/dist/components/Form/SuperSelect.js +67 -58
  23. package/dist/components/Form/SuperSelect.js.map +1 -1
  24. package/dist/components/Form/createPagedSuperSelectApi.d.ts +60 -0
  25. package/dist/components/Form/createPagedSuperSelectApi.js +46 -0
  26. package/dist/components/Form/createPagedSuperSelectApi.js.map +1 -0
  27. package/dist/components/Form/index.d.ts +3 -0
  28. package/dist/components/Form/superSelectEmpty.d.ts +5 -0
  29. package/dist/components/Form/superSelectEmpty.js +11 -0
  30. package/dist/components/Form/superSelectEmpty.js.map +1 -0
  31. package/dist/components/FormInfo/fields.d.ts +2 -0
  32. package/dist/components/FormInfo/fields.js.map +1 -1
  33. package/dist/components/FormInfo/index.d.ts +2 -2
  34. package/dist/components/ReactFilter/fields/index.js +35 -27
  35. package/dist/components/ReactFilter/fields/index.js.map +1 -1
  36. package/dist/components/Tools/ActionTracking/Cancel/CancelExecutionModal.d.ts +20 -0
  37. package/dist/components/Tools/ActionTracking/Cancel/CancelExecutionModal.js +82 -0
  38. package/dist/components/Tools/ActionTracking/Cancel/CancelExecutionModal.js.map +1 -0
  39. package/dist/components/Tools/ActionTracking/Cancel/CancelExecutionModal.module.scss.js +7 -0
  40. package/dist/components/Tools/ActionTracking/Cancel/CancelExecutionModal.module.scss.js.map +1 -0
  41. package/dist/components/Tools/ActionTracking/Cancel/index.d.ts +3 -0
  42. package/dist/components/Tools/ActionTracking/CreateAction/CreateActionForm.d.ts +25 -0
  43. package/dist/components/Tools/ActionTracking/CreateAction/CreateActionForm.js +257 -0
  44. package/dist/components/Tools/ActionTracking/CreateAction/CreateActionForm.js.map +1 -0
  45. package/dist/components/Tools/ActionTracking/CreateAction/CreateActionForm.module.scss.js +10 -0
  46. package/dist/components/Tools/ActionTracking/CreateAction/CreateActionForm.module.scss.js.map +1 -0
  47. package/dist/components/Tools/ActionTracking/CreateAction/CreateActionModal.d.ts +47 -0
  48. package/dist/components/Tools/ActionTracking/CreateAction/CreateActionModal.js +148 -0
  49. package/dist/components/Tools/ActionTracking/CreateAction/CreateActionModal.js.map +1 -0
  50. package/dist/components/Tools/ActionTracking/CreateAction/CreateActionModal.module.scss.js +7 -0
  51. package/dist/components/Tools/ActionTracking/CreateAction/CreateActionModal.module.scss.js.map +1 -0
  52. package/dist/components/Tools/ActionTracking/CreateAction/PersonRoleCascader.d.ts +18 -0
  53. package/dist/components/Tools/ActionTracking/CreateAction/PersonRoleCascader.js +73 -0
  54. package/dist/components/Tools/ActionTracking/CreateAction/PersonRoleCascader.js.map +1 -0
  55. package/dist/components/Tools/ActionTracking/CreateAction/PersonRoleCascader.module.scss.js +5 -0
  56. package/dist/components/Tools/ActionTracking/CreateAction/PersonRoleCascader.module.scss.js.map +1 -0
  57. package/dist/components/Tools/ActionTracking/CreateAction/PersonRoleCascaderField.d.ts +19 -0
  58. package/dist/components/Tools/ActionTracking/CreateAction/PersonRoleCascaderField.js +62 -0
  59. package/dist/components/Tools/ActionTracking/CreateAction/PersonRoleCascaderField.js.map +1 -0
  60. package/dist/components/Tools/ActionTracking/CreateAction/PersonRoleCascaderField.module.scss.js +8 -0
  61. package/dist/components/Tools/ActionTracking/CreateAction/PersonRoleCascaderField.module.scss.js.map +1 -0
  62. package/dist/components/Tools/ActionTracking/CreateAction/SetFormFields.d.ts +4 -0
  63. package/dist/components/Tools/ActionTracking/CreateAction/SetFormFields.js +14 -0
  64. package/dist/components/Tools/ActionTracking/CreateAction/SetFormFields.js.map +1 -0
  65. package/dist/components/Tools/ActionTracking/CreateAction/index.d.ts +12 -0
  66. package/dist/components/Tools/ActionTracking/CreateAction/personCascadePath.d.ts +5 -0
  67. package/dist/components/Tools/ActionTracking/CreateAction/personCascadePath.js +30 -0
  68. package/dist/components/Tools/ActionTracking/CreateAction/personCascadePath.js.map +1 -0
  69. package/dist/components/Tools/ActionTracking/CreateAction/submitHelpers.d.ts +8 -0
  70. package/dist/components/Tools/ActionTracking/CreateAction/submitHelpers.js +35 -0
  71. package/dist/components/Tools/ActionTracking/CreateAction/submitHelpers.js.map +1 -0
  72. package/dist/components/Tools/ActionTracking/CreateAction/types.d.ts +108 -0
  73. package/dist/components/Tools/ActionTracking/Follow/ActionFollowModal.d.ts +27 -0
  74. package/dist/components/Tools/ActionTracking/Follow/ActionFollowModal.js +107 -0
  75. package/dist/components/Tools/ActionTracking/Follow/ActionFollowModal.js.map +1 -0
  76. package/dist/components/Tools/ActionTracking/Follow/ActionFollowModal.module.scss.js +11 -0
  77. package/dist/components/Tools/ActionTracking/Follow/ActionFollowModal.module.scss.js.map +1 -0
  78. package/dist/components/Tools/ActionTracking/Follow/index.d.ts +3 -0
  79. package/dist/components/Tools/ActionTracking/List/ActionFilterBar.d.ts +23 -0
  80. package/dist/components/Tools/ActionTracking/List/ActionFilterBar.js +31 -0
  81. package/dist/components/Tools/ActionTracking/List/ActionFilterBar.js.map +1 -0
  82. package/dist/components/Tools/ActionTracking/List/ActionFilterBar.module.scss.js +8 -0
  83. package/dist/components/Tools/ActionTracking/List/ActionFilterBar.module.scss.js.map +1 -0
  84. package/dist/components/Tools/ActionTracking/List/ActionListTable.d.ts +29 -0
  85. package/dist/components/Tools/ActionTracking/List/ActionListTable.js +76 -0
  86. package/dist/components/Tools/ActionTracking/List/ActionListTable.js.map +1 -0
  87. package/dist/components/Tools/ActionTracking/List/ActionListTable.module.scss.js +8 -0
  88. package/dist/components/Tools/ActionTracking/List/ActionListTable.module.scss.js.map +1 -0
  89. package/dist/components/Tools/ActionTracking/List/filterDefaults.d.ts +15 -0
  90. package/dist/components/Tools/ActionTracking/List/filterDefaults.js +27 -0
  91. package/dist/components/Tools/ActionTracking/List/filterDefaults.js.map +1 -0
  92. package/dist/components/Tools/ActionTracking/List/index.d.ts +6 -0
  93. package/dist/components/Tools/ActionTracking/List/listTypes.d.ts +49 -0
  94. package/dist/components/Tools/ActionTracking/{ActionTrackingShell.d.ts → Shell/ActionTrackingShell.d.ts} +1 -1
  95. package/dist/components/Tools/ActionTracking/{ActionTrackingShell.js → Shell/ActionTrackingShell.js} +1 -1
  96. package/dist/components/Tools/ActionTracking/Shell/ActionTrackingShell.js.map +1 -0
  97. package/dist/components/Tools/ActionTracking/Shell/index.d.ts +3 -0
  98. package/dist/components/Tools/ActionTracking/index.d.ts +11 -2
  99. package/dist/components/Tools/ActionTracking/utils/index.d.ts +1 -0
  100. package/dist/components/Tools/ActionTracking/utils/sanitizeActionHtml.d.ts +2 -0
  101. package/dist/components/Tools/index.d.ts +2 -0
  102. package/dist/form-info.d.ts +3 -0
  103. package/dist/form-info.js +80 -72
  104. package/dist/form-info.js.map +1 -1
  105. package/dist/index.js +867 -820
  106. package/dist/index.js.map +1 -1
  107. package/dist/marsun-components-core.css +2 -2
  108. package/dist/styles/global.css +2 -2
  109. package/package.json +1 -1
  110. package/dist/components/Tools/ActionTracking/ActionTrackingShell.js.map +0 -1
  111. /package/dist/components/Tools/ActionTracking/{style.module.scss.js → Shell/style.module.scss.js} +0 -0
  112. /package/dist/components/Tools/ActionTracking/{style.module.scss.js.map → Shell/style.module.scss.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createPagedSuperSelectApi.js","sources":["../../../src/components/Form/createPagedSuperSelectApi.ts"],"sourcesContent":["/**\n * kne SuperSelect 远程分页下拉(对齐 EAM CycleForm / materialFilterRemoteSelect)。\n * App 注入 loadPage;core 禁直连业务 API。\n */\n\nexport const PAGED_SUPER_SELECT_PAGE_SIZE = 50;\n\nexport type PagedSuperSelectOption = {\n label: string;\n value: string;\n};\n\nexport type PagedSuperSelectQuery = {\n keyword?: string;\n currentPage: number;\n pageSize: number;\n};\n\nexport type PagedSuperSelectPage = {\n pageData: PagedSuperSelectOption[];\n totalCount: number;\n};\n\nexport type CreatePagedSuperSelectApiOptions = {\n pageSize?: number;\n loadPage: (query: PagedSuperSelectQuery) => Promise<PagedSuperSelectPage>;\n /** 失败时回调(如 message.error);未传则静默空页 */\n onError?: (error: unknown) => void;\n};\n\ntype KneLoaderData = {\n currentPage?: number;\n perPage?: number;\n keyword?: string;\n};\n\n/** kne SuperSelect.api:data + loader → { pageData, totalCount } */\nexport function createPagedSuperSelectApi(options: CreatePagedSuperSelectApiOptions) {\n const pageSize = options.pageSize ?? PAGED_SUPER_SELECT_PAGE_SIZE;\n return {\n data: {\n currentPage: 1,\n perPage: pageSize,\n keyword: '',\n },\n loader: async ({ data }: { data?: KneLoaderData }) => {\n try {\n return await options.loadPage({\n keyword: data?.keyword,\n currentPage: data?.currentPage ?? 1,\n pageSize: data?.perPage ?? pageSize,\n });\n } catch (error) {\n options.onError?.(error);\n return { pageData: [] as PagedSuperSelectOption[], totalCount: 0 };\n }\n },\n };\n}\n\n/** kne SuperSelect.getSearchProps:搜索重置到第 1 页 */\nexport function pagedSuperSelectGetSearchProps(\n pageSize: number = PAGED_SUPER_SELECT_PAGE_SIZE,\n): (args: { searchText?: string }) => {\n keyword: string;\n currentPage: number;\n perPage: number;\n} {\n return ({ searchText }) => ({\n keyword: searchText || '',\n currentPage: 1,\n perPage: pageSize,\n });\n}\n\n/**\n * kne FetchScrollLoader:`open:false` = 滚动加载(非翻页器)。\n * 与 EAM machineFilterPagination / energyMaterialFilterPagination 同口径。\n */\nexport function pagedSuperSelectPagination(pageSize: number = PAGED_SUPER_SELECT_PAGE_SIZE): {\n open: false;\n paramsType: 'data';\n current: 'currentPage';\n pageSizeName: 'perPage';\n pageSize: number;\n} {\n return {\n open: false,\n paramsType: 'data',\n current: 'currentPage',\n pageSizeName: 'perPage',\n pageSize,\n };\n}\n"],"names":["PAGED_SUPER_SELECT_PAGE_SIZE","createPagedSuperSelectApi","options","pageSize","data","_a","error","pagedSuperSelectGetSearchProps","searchText","pagedSuperSelectPagination"],"mappings":"AAKO,MAAMA,IAA+B;AAgCrC,SAASC,EAA0BC,GAA2C;AACnF,QAAMC,IAAWD,EAAQ,YAAY;AACrC,SAAO;AAAA,IACL,MAAM;AAAA,MACJ,aAAa;AAAA,MACb,SAASC;AAAA,MACT,SAAS;AAAA,IAAA;AAAA,IAEX,QAAQ,OAAO,EAAE,MAAAC,QAAqC;AAxCnD,UAAAC;AAyCD,UAAI;AACF,eAAO,MAAMH,EAAQ,SAAS;AAAA,UAC5B,SAASE,KAAA,gBAAAA,EAAM;AAAA,UACf,cAAaA,KAAA,gBAAAA,EAAM,gBAAe;AAAA,UAClC,WAAUA,KAAA,gBAAAA,EAAM,YAAWD;AAAA,QAAA,CAC5B;AAAA,MACH,SAASG,GAAO;AACd,gBAAAD,IAAAH,EAAQ,YAAR,QAAAG,EAAA,KAAAH,GAAkBI,IACX,EAAE,UAAU,IAAgC,YAAY,EAAA;AAAA,MACjE;AAAA,IACF;AAAA,EAAA;AAEJ;AAGO,SAASC,EACdJ,IAAmB,IAKnB;AACA,SAAO,CAAC,EAAE,YAAAK,SAAkB;AAAA,IAC1B,SAASA,KAAc;AAAA,IACvB,aAAa;AAAA,IACb,SAASL;AAAA,EAAA;AAEb;AAMO,SAASM,EAA2BN,IAAmB,IAM5D;AACA,SAAO;AAAA,IACL,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,cAAc;AAAA,IACd,UAAAA;AAAA,EAAA;AAEJ;"}
@@ -14,6 +14,9 @@ export { inputRangeRules, validateRangeAsc, RANGE_ASC_RULE_NAME } from './inputR
14
14
  export type { KneRuleResult } from './inputRangeRules';
15
15
  export { SuperSelect, SUPER_SELECT_ALL_VALUE, isSuperSelectAllValue } from './SuperSelect';
16
16
  export type { SuperSelectProps, SuperSelectOption } from './SuperSelect';
17
+ export { SUPER_SELECT_EMPTY_TEXT, defaultSuperSelectEmpty } from './superSelectEmpty';
18
+ export { createPagedSuperSelectApi, pagedSuperSelectGetSearchProps, pagedSuperSelectPagination, PAGED_SUPER_SELECT_PAGE_SIZE, } from './createPagedSuperSelectApi';
19
+ export type { PagedSuperSelectOption, PagedSuperSelectQuery, PagedSuperSelectPage, CreatePagedSuperSelectApiOptions, } from './createPagedSuperSelectApi';
17
20
  /** @kne/form-info — 业务从包根导入,勿直连 @kne/form-info */
18
21
  export { FormInfo, Form, FormModal, FormSteps, FormStepsModal, List, TableList, MultiField, Input, TextArea, Select, TreeSelect, InputNumber, Switch, RadioGroup, SubmitButton, ResetButton, CancelButton, } from './kneFormInfo';
19
22
  export type { FormInfoProps, FormProps, FormModalProps, FormStepsProps, FormStepsModalProps, ListProps, TableListProps, MultiFieldProps, } from './kneFormInfo';
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ /** kne SuperSelect / Filter 空列表文案(禁组件默认英文空态) */
3
+ export declare const SUPER_SELECT_EMPTY_TEXT = "\u6682\u65E0\u6570\u636E";
4
+ /** kne `empty` 默认节点;调用方可覆盖 */
5
+ export declare function defaultSuperSelectEmpty(): ReactNode;
@@ -0,0 +1,11 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Empty as E } from "antd";
3
+ const r = "暂无数据";
4
+ function m() {
5
+ return /* @__PURE__ */ t(E, { image: E.PRESENTED_IMAGE_SIMPLE, description: r });
6
+ }
7
+ export {
8
+ r as SUPER_SELECT_EMPTY_TEXT,
9
+ m as defaultSuperSelectEmpty
10
+ };
11
+ //# sourceMappingURL=superSelectEmpty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"superSelectEmpty.js","sources":["../../../src/components/Form/superSelectEmpty.tsx"],"sourcesContent":["import { Empty } from 'antd';\nimport type { ReactNode } from 'react';\n\n/** kne SuperSelect / Filter 空列表文案(禁组件默认英文空态) */\nexport const SUPER_SELECT_EMPTY_TEXT = '暂无数据';\n\n/** kne `empty` 默认节点;调用方可覆盖 */\nexport function defaultSuperSelectEmpty(): ReactNode {\n return <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={SUPER_SELECT_EMPTY_TEXT} />;\n}\n"],"names":["SUPER_SELECT_EMPTY_TEXT","defaultSuperSelectEmpty","Empty"],"mappings":";;AAIO,MAAMA,IAA0B;AAGhC,SAASC,IAAqC;AACnD,2BAAQC,GAAA,EAAM,OAAOA,EAAM,wBAAwB,aAAaF,GAAyB;AAC3F;"}
@@ -31,6 +31,8 @@ export declare const Select: ComponentType<FieldProps>;
31
31
  export declare const TreeSelect: ComponentType<FieldProps>;
32
32
  export { SuperSelect, SUPER_SELECT_ALL_VALUE, isSuperSelectAllValue, } from '../Form/SuperSelect';
33
33
  export type { SuperSelectProps, SuperSelectOption } from '../Form/SuperSelect';
34
+ export { createPagedSuperSelectApi, pagedSuperSelectGetSearchProps, pagedSuperSelectPagination, PAGED_SUPER_SELECT_PAGE_SIZE, } from '../Form/createPagedSuperSelectApi';
35
+ export type { PagedSuperSelectOption, PagedSuperSelectQuery, PagedSuperSelectPage, CreatePagedSuperSelectApiOptions, } from '../Form/createPagedSuperSelectApi';
34
36
  export declare const InputNumber: ComponentType<FieldProps>;
35
37
  export declare const Switch: ComponentType<FieldProps>;
36
38
  export declare const RadioGroup: ComponentType<FieldProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"fields.js","sources":["../../../src/components/FormInfo/fields.tsx"],"sourcesContent":["/**\n * FormInfo Input 扩展:enableVariableMention 时走 VariableMentionField(「插入变量」→ {{key}})。\n */\nimport {\n CancelButton as BaseCancelButton,\n Input as BaseInput,\n InputNumber as BaseInputNumber,\n RadioGroup as BaseRadioGroup,\n ResetButton as BaseResetButton,\n Select as BaseSelect,\n SubmitButton as BaseSubmitButton,\n Switch as BaseSwitch,\n TextArea as BaseTextArea,\n TreeSelect as BaseTreeSelect,\n} from '@kne/react-form-antd';\nimport { type ComponentType, type ReactNode } from 'react';\nimport { withNormalizedLabelTips } from '@/components/Form/normalizeLabelTips';\nimport { VariableMentionField } from './VariableMentionInput';\nimport type { VariableMentionItem } from '@/components/Editor/variableMention';\n\ntype FieldProps = {\n name: string;\n label?: ReactNode;\n labelTips?: ReactNode | ((props: FieldProps) => ReactNode);\n rule?: string;\n placeholder?: string;\n disabled?: boolean;\n block?: boolean;\n rows?: number;\n options?: unknown[];\n /** 开启「插入变量」;与 variables 联用 */\n enableVariableMention?: boolean;\n variables?: VariableMentionItem[];\n catalogError?: string;\n [key: string]: unknown;\n};\n\ntype ButtonProps = {\n children?: ReactNode;\n type?: string;\n loading?: boolean;\n [key: string]: unknown;\n};\n\ntype InputType = ComponentType<FieldProps> & { Password: ComponentType<FieldProps> };\n\nconst InputBase = BaseInput as unknown as InputType;\n\nfunction InputSwitch(props: FieldProps) {\n if (props.enableVariableMention) {\n return <VariableMentionField {...props} />;\n }\n return <InputBase {...props} />;\n}\n\nexport const Input = Object.assign(\n withNormalizedLabelTips(InputSwitch as ComponentType<FieldProps>),\n {\n Password: withNormalizedLabelTips(InputBase.Password),\n },\n) as InputType;\n\nexport const TextArea = withNormalizedLabelTips(\n BaseTextArea as ComponentType<FieldProps>,\n) as ComponentType<FieldProps>;\nexport const Select = withNormalizedLabelTips(\n BaseSelect as ComponentType<FieldProps>,\n) as ComponentType<FieldProps>;\nexport const TreeSelect = withNormalizedLabelTips(\n BaseTreeSelect as ComponentType<FieldProps>,\n) as ComponentType<FieldProps>;\n\nexport {\n SuperSelect,\n SUPER_SELECT_ALL_VALUE,\n isSuperSelectAllValue,\n} from '@/components/Form/SuperSelect';\nexport type { SuperSelectProps, SuperSelectOption } from '@/components/Form/SuperSelect';\nexport const InputNumber = withNormalizedLabelTips(\n BaseInputNumber as ComponentType<FieldProps>,\n) as ComponentType<FieldProps>;\nexport const Switch = withNormalizedLabelTips(\n BaseSwitch as ComponentType<FieldProps>,\n) as ComponentType<FieldProps>;\nexport const RadioGroup = withNormalizedLabelTips(\n BaseRadioGroup as ComponentType<FieldProps>,\n) as ComponentType<FieldProps>;\n\nexport const SubmitButton = BaseSubmitButton as ComponentType<ButtonProps>;\nexport const ResetButton = BaseResetButton as ComponentType<ButtonProps>;\nexport const CancelButton = BaseCancelButton as ComponentType<ButtonProps>;\n"],"names":["InputBase","BaseInput","InputSwitch","props","jsx","VariableMentionField","Input","withNormalizedLabelTips","TextArea","BaseTextArea","Select","BaseSelect","TreeSelect","BaseTreeSelect","InputNumber","BaseInputNumber","Switch","BaseSwitch","RadioGroup","BaseRadioGroup","SubmitButton","BaseSubmitButton","ResetButton","BaseResetButton","CancelButton","BaseCancelButton"],"mappings":";;;;AA8CA,MAAMA,IAAYC;AAElB,SAASC,EAAYC,GAAmB;AACtC,SAAIA,EAAM,wBACD,gBAAAC,EAACC,GAAA,EAAsB,GAAGF,EAAA,CAAO,IAEnC,gBAAAC,EAACJ,GAAA,EAAW,GAAGG,EAAA,CAAO;AAC/B;AAEO,MAAMG,IAAQ,OAAO;AAAA,EAC1BC,EAAwBL,CAAwC;AAAA,EAChE;AAAA,IACE,UAAUK,EAAwBP,EAAU,QAAQ;AAAA,EAAA;AAExD,GAEaQ,IAAWD;AAAA,EACtBE;AACF,GACaC,IAASH;AAAA,EACpBI;AACF,GACaC,IAAaL;AAAA,EACxBM;AACF,GAQaC,IAAcP;AAAA,EACzBQ;AACF,GACaC,IAAST;AAAA,EACpBU;AACF,GACaC,IAAaX;AAAA,EACxBY;AACF,GAEaC,IAAeC,GACfC,IAAcC,GACdC,IAAeC;"}
1
+ {"version":3,"file":"fields.js","sources":["../../../src/components/FormInfo/fields.tsx"],"sourcesContent":["/**\n * FormInfo Input 扩展:enableVariableMention 时走 VariableMentionField(「插入变量」→ {{key}})。\n */\nimport {\n CancelButton as BaseCancelButton,\n Input as BaseInput,\n InputNumber as BaseInputNumber,\n RadioGroup as BaseRadioGroup,\n ResetButton as BaseResetButton,\n Select as BaseSelect,\n SubmitButton as BaseSubmitButton,\n Switch as BaseSwitch,\n TextArea as BaseTextArea,\n TreeSelect as BaseTreeSelect,\n} from '@kne/react-form-antd';\nimport { type ComponentType, type ReactNode } from 'react';\nimport { withNormalizedLabelTips } from '@/components/Form/normalizeLabelTips';\nimport { VariableMentionField } from './VariableMentionInput';\nimport type { VariableMentionItem } from '@/components/Editor/variableMention';\n\ntype FieldProps = {\n name: string;\n label?: ReactNode;\n labelTips?: ReactNode | ((props: FieldProps) => ReactNode);\n rule?: string;\n placeholder?: string;\n disabled?: boolean;\n block?: boolean;\n rows?: number;\n options?: unknown[];\n /** 开启「插入变量」;与 variables 联用 */\n enableVariableMention?: boolean;\n variables?: VariableMentionItem[];\n catalogError?: string;\n [key: string]: unknown;\n};\n\ntype ButtonProps = {\n children?: ReactNode;\n type?: string;\n loading?: boolean;\n [key: string]: unknown;\n};\n\ntype InputType = ComponentType<FieldProps> & { Password: ComponentType<FieldProps> };\n\nconst InputBase = BaseInput as unknown as InputType;\n\nfunction InputSwitch(props: FieldProps) {\n if (props.enableVariableMention) {\n return <VariableMentionField {...props} />;\n }\n return <InputBase {...props} />;\n}\n\nexport const Input = Object.assign(\n withNormalizedLabelTips(InputSwitch as ComponentType<FieldProps>),\n {\n Password: withNormalizedLabelTips(InputBase.Password),\n },\n) as InputType;\n\nexport const TextArea = withNormalizedLabelTips(\n BaseTextArea as ComponentType<FieldProps>,\n) as ComponentType<FieldProps>;\nexport const Select = withNormalizedLabelTips(\n BaseSelect as ComponentType<FieldProps>,\n) as ComponentType<FieldProps>;\nexport const TreeSelect = withNormalizedLabelTips(\n BaseTreeSelect as ComponentType<FieldProps>,\n) as ComponentType<FieldProps>;\n\nexport {\n SuperSelect,\n SUPER_SELECT_ALL_VALUE,\n isSuperSelectAllValue,\n} from '@/components/Form/SuperSelect';\nexport type { SuperSelectProps, SuperSelectOption } from '@/components/Form/SuperSelect';\nexport {\n createPagedSuperSelectApi,\n pagedSuperSelectGetSearchProps,\n pagedSuperSelectPagination,\n PAGED_SUPER_SELECT_PAGE_SIZE,\n} from '@/components/Form/createPagedSuperSelectApi';\nexport type {\n PagedSuperSelectOption,\n PagedSuperSelectQuery,\n PagedSuperSelectPage,\n CreatePagedSuperSelectApiOptions,\n} from '@/components/Form/createPagedSuperSelectApi';\nexport const InputNumber = withNormalizedLabelTips(\n BaseInputNumber as ComponentType<FieldProps>,\n) as ComponentType<FieldProps>;\nexport const Switch = withNormalizedLabelTips(\n BaseSwitch as ComponentType<FieldProps>,\n) as ComponentType<FieldProps>;\nexport const RadioGroup = withNormalizedLabelTips(\n BaseRadioGroup as ComponentType<FieldProps>,\n) as ComponentType<FieldProps>;\n\nexport const SubmitButton = BaseSubmitButton as ComponentType<ButtonProps>;\nexport const ResetButton = BaseResetButton as ComponentType<ButtonProps>;\nexport const CancelButton = BaseCancelButton as ComponentType<ButtonProps>;\n"],"names":["InputBase","BaseInput","InputSwitch","props","jsx","VariableMentionField","Input","withNormalizedLabelTips","TextArea","BaseTextArea","Select","BaseSelect","TreeSelect","BaseTreeSelect","InputNumber","BaseInputNumber","Switch","BaseSwitch","RadioGroup","BaseRadioGroup","SubmitButton","BaseSubmitButton","ResetButton","BaseResetButton","CancelButton","BaseCancelButton"],"mappings":";;;;AA8CA,MAAMA,IAAYC;AAElB,SAASC,EAAYC,GAAmB;AACtC,SAAIA,EAAM,wBACD,gBAAAC,EAACC,GAAA,EAAsB,GAAGF,EAAA,CAAO,IAEnC,gBAAAC,EAACJ,GAAA,EAAW,GAAGG,EAAA,CAAO;AAC/B;AAEO,MAAMG,IAAQ,OAAO;AAAA,EAC1BC,EAAwBL,CAAwC;AAAA,EAChE;AAAA,IACE,UAAUK,EAAwBP,EAAU,QAAQ;AAAA,EAAA;AAExD,GAEaQ,IAAWD;AAAA,EACtBE;AACF,GACaC,IAASH;AAAA,EACpBI;AACF,GACaC,IAAaL;AAAA,EACxBM;AACF,GAoBaC,IAAcP;AAAA,EACzBQ;AACF,GACaC,IAAST;AAAA,EACpBU;AACF,GACaC,IAAaX;AAAA,EACxBY;AACF,GAEaC,IAAeC,GACfC,IAAcC,GACdC,IAAeC;"}
@@ -17,8 +17,8 @@ export { default as Steps, validateFieldsByName } from './Steps';
17
17
  export { default as FormSteps } from './FormSteps';
18
18
  export { default as FormStepsModal, useFormStepModal } from './FormStepsModal';
19
19
  export { buildFormOverlayProps } from './buildFormOverlayProps';
20
- export { Input, TextArea, Select, TreeSelect, InputNumber, Switch, RadioGroup, SubmitButton, ResetButton, CancelButton, SuperSelect, SUPER_SELECT_ALL_VALUE, isSuperSelectAllValue, } from './fields';
21
- export type { SuperSelectProps, SuperSelectOption } from './fields';
20
+ export { Input, TextArea, Select, TreeSelect, InputNumber, Switch, RadioGroup, SubmitButton, ResetButton, CancelButton, SuperSelect, SUPER_SELECT_ALL_VALUE, isSuperSelectAllValue, createPagedSuperSelectApi, pagedSuperSelectGetSearchProps, pagedSuperSelectPagination, PAGED_SUPER_SELECT_PAGE_SIZE, } from './fields';
21
+ export type { SuperSelectProps, SuperSelectOption, PagedSuperSelectOption, PagedSuperSelectQuery, PagedSuperSelectPage, CreatePagedSuperSelectApiOptions, } from './fields';
22
22
  export { RichTextField } from './RichTextField';
23
23
  export type { RichTextFieldProps } from './RichTextField';
24
24
  export { VariableMentionField } from './VariableMentionInput';
@@ -3,46 +3,54 @@ import { useIntl as p } from "@kne/react-intl";
3
3
  import e from "../withFieldItem.js";
4
4
  import u from "./InputFilterItem.js";
5
5
  import n from "./NumberRangeFilterItem.js";
6
- import s from "../withLocale.js";
7
- import a, { SelectTableList as f, SelectCascader as I } from "@kne/super-select";
8
- import { SelectFunction as d, SelectIndustry as F, SelectAddress as S } from "@kne/super-select-plus";
6
+ import a from "../withLocale.js";
7
+ import s, { SelectTableList as f, SelectCascader as I } from "@kne/super-select";
8
+ import { SelectFunction as d, SelectIndustry as S, SelectAddress as F } from "@kne/super-select-plus";
9
9
  /* empty css */
10
10
  /* empty css */
11
11
  /* empty css */
12
12
  import { renderSelectListItemContent as P } from "../renderSelectListItemContent.js";
13
- import { default as G } from "./DatePickerFilterItem.js";
14
- import { default as J } from "./DateRangePickerFilterItem.js";
15
- import { default as O } from "./TypeDateRangePickerFilterItem.js";
16
- import { default as U } from "./SelectTreeFilterItem.js";
17
- const m = (t) => s(({ placeholder: r, label: o, ...i }) => {
13
+ import { defaultSuperSelectEmpty as h } from "../../Form/superSelectEmpty.js";
14
+ import { default as J } from "./DatePickerFilterItem.js";
15
+ import { default as O } from "./DateRangePickerFilterItem.js";
16
+ import { default as U } from "./TypeDateRangePickerFilterItem.js";
17
+ import { default as X } from "./SelectTreeFilterItem.js";
18
+ const m = (r) => a(({ placeholder: o, label: t, ...i }) => {
18
19
  const { formatMessage: c } = p({ moduleName: "Filter" });
19
20
  return /* @__PURE__ */ l(
20
- t,
21
+ r,
21
22
  {
22
23
  ...i,
23
- label: o,
24
- placeholder: r || c({ id: "defaultInputPlaceholder" }, { label: o })
24
+ label: t,
25
+ placeholder: o || c({ id: "defaultInputPlaceholder" }, { label: t })
25
26
  }
26
27
  );
27
28
  });
28
- function h({ renderItemContent: t, ...r }) {
29
- return /* @__PURE__ */ l(a, { ...r, renderItemContent: t || P });
29
+ function x({ renderItemContent: r, empty: o, ...t }) {
30
+ return /* @__PURE__ */ l(
31
+ s,
32
+ {
33
+ ...t,
34
+ empty: o ?? h(),
35
+ renderItemContent: r || P
36
+ }
37
+ );
30
38
  }
31
- const A = m(u), $ = m(n), j = e(h, {
39
+ const $ = m(u), j = m(n), M = e(x, {
32
40
  forcePopup: !0
33
- }), E = e(f, { forcePopup: !0 }), M = e(I, { forcePopup: !0 }), W = e(d, { forcePopup: !0 }), q = e(F, { forcePopup: !0 }), v = e(S, { forcePopup: !0 });
41
+ }), W = e(f, { forcePopup: !0 }), q = e(I, { forcePopup: !0 }), v = e(d, { forcePopup: !0 }), z = e(S, { forcePopup: !0 }), B = e(F, { forcePopup: !0 });
34
42
  export {
35
- G as DatePickerFilterItem,
36
- J as DateRangePickerFilterItem,
37
- A as InputFilterItem,
38
- $ as NumberRangeFilterItem,
39
- v as SelectAddressFilterItem,
40
- M as SelectCascaderFilterItem,
41
- W as SelectFunctionFilterItem,
42
- q as SelectIndustryFilterItem,
43
- E as SelectTableListFilterItem,
44
- U as SelectTreeFilterItem,
45
- j as SuperSelectFilterItem,
46
- O as TypeDateRangePickerFilterItem
43
+ J as DatePickerFilterItem,
44
+ O as DateRangePickerFilterItem,
45
+ $ as InputFilterItem,
46
+ j as NumberRangeFilterItem,
47
+ B as SelectAddressFilterItem,
48
+ q as SelectCascaderFilterItem,
49
+ v as SelectFunctionFilterItem,
50
+ z as SelectIndustryFilterItem,
51
+ W as SelectTableListFilterItem,
52
+ X as SelectTreeFilterItem,
53
+ M as SuperSelectFilterItem,
54
+ U as TypeDateRangePickerFilterItem
47
55
  };
48
56
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/ReactFilter/fields/index.jsx"],"sourcesContent":["// @ts-nocheck\nimport { useIntl } from '@kne/react-intl';\nimport withFieldItem from '../withFieldItem';\nimport InputFilterItemField from './InputFilterItem';\nimport NumberRangeFilterItemField from './NumberRangeFilterItem';\nimport withLocale from '../withLocale';\nimport SuperSelect, { SelectCascader, SelectTableList } from '@kne/super-select';\nimport { SelectAddress, SelectFunction, SelectIndustry } from '@kne/super-select-plus';\nimport '@kne/super-select/dist/index.css';\nimport '@kne/super-select-plus/dist/index.css';\n/** SuperSelect / SelectTree 弹层全局修补(选项撑满、checkbox、叶子 switcher-noop) */\nimport '../superSelectPopup.scss';\nimport { renderSelectListItemContent } from '../renderSelectListItemContent';\n\nconst withInputDefaultPlaceholder = (WrappedComponent) =>\n withLocale(({ placeholder, label, ...props }) => {\n const { formatMessage } = useIntl({ moduleName: 'Filter' });\n return (\n <WrappedComponent\n {...props}\n label={label}\n placeholder={placeholder || formatMessage({ id: 'defaultInputPlaceholder' }, { label })}\n />\n );\n });\n\n/** 默认超长省略 + title hover;业务可传 renderItemContent 覆盖 */\nfunction SuperSelectWithLabelEllipsis({ renderItemContent, ...props }) {\n return (\n <SuperSelect {...props} renderItemContent={renderItemContent || renderSelectListItemContent} />\n );\n}\n\nexport const InputFilterItem = withInputDefaultPlaceholder(InputFilterItemField);\nexport const NumberRangeFilterItem = withInputDefaultPlaceholder(NumberRangeFilterItemField);\n\nexport { default as DatePickerFilterItem } from './DatePickerFilterItem';\nexport { default as DateRangePickerFilterItem } from './DateRangePickerFilterItem';\nexport { default as TypeDateRangePickerFilterItem } from './TypeDateRangePickerFilterItem';\n\nexport const SuperSelectFilterItem = withFieldItem(SuperSelectWithLabelEllipsis, {\n forcePopup: true,\n});\nexport const SelectTableListFilterItem = withFieldItem(SelectTableList, { forcePopup: true });\nexport { default as SelectTreeFilterItem } from './SelectTreeFilterItem';\nexport const SelectCascaderFilterItem = withFieldItem(SelectCascader, { forcePopup: true });\nexport const SelectFunctionFilterItem = withFieldItem(SelectFunction, { forcePopup: true });\nexport const SelectIndustryFilterItem = withFieldItem(SelectIndustry, { forcePopup: true });\nexport const SelectAddressFilterItem = withFieldItem(SelectAddress, { forcePopup: true });\n"],"names":["withInputDefaultPlaceholder","WrappedComponent","withLocale","placeholder","label","props","formatMessage","useIntl","jsx","SuperSelectWithLabelEllipsis","renderItemContent","SuperSelect","renderSelectListItemContent","InputFilterItem","InputFilterItemField","NumberRangeFilterItem","NumberRangeFilterItemField","SuperSelectFilterItem","withFieldItem","SelectTableListFilterItem","SelectTableList","SelectCascaderFilterItem","SelectCascader","SelectFunctionFilterItem","SelectFunction","SelectIndustryFilterItem","SelectIndustry","SelectAddressFilterItem","SelectAddress"],"mappings":";;;;;;;;;;;;;;;;AAcA,MAAMA,IAA8B,CAACC,MACnCC,EAAW,CAAC,EAAE,aAAAC,GAAa,OAAAC,GAAO,GAAGC,QAAY;AAC/C,QAAM,EAAE,eAAAC,EAAA,IAAkBC,EAAQ,EAAE,YAAY,UAAU;AAC1D,SACE,gBAAAC;AAAA,IAACP;AAAA,IAAA;AAAA,MACE,GAAGI;AAAA,MACJ,OAAAD;AAAA,MACA,aAAaD,KAAeG,EAAc,EAAE,IAAI,0BAAA,GAA6B,EAAE,OAAAF,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAG5F,CAAC;AAGH,SAASK,EAA6B,EAAE,mBAAAC,GAAmB,GAAGL,KAAS;AACrE,2BACGM,GAAA,EAAa,GAAGN,GAAO,mBAAmBK,KAAqBE,GAA6B;AAEjG;AAEO,MAAMC,IAAkBb,EAA4Bc,CAAoB,GAClEC,IAAwBf,EAA4BgB,CAA0B,GAM9EC,IAAwBC,EAAcT,GAA8B;AAAA,EAC/E,YAAY;AACd,CAAC,GACYU,IAA4BD,EAAcE,GAAiB,EAAE,YAAY,IAAM,GAE/EC,IAA2BH,EAAcI,GAAgB,EAAE,YAAY,IAAM,GAC7EC,IAA2BL,EAAcM,GAAgB,EAAE,YAAY,IAAM,GAC7EC,IAA2BP,EAAcQ,GAAgB,EAAE,YAAY,IAAM,GAC7EC,IAA0BT,EAAcU,GAAe,EAAE,YAAY,IAAM;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/ReactFilter/fields/index.jsx"],"sourcesContent":["// @ts-nocheck\nimport { useIntl } from '@kne/react-intl';\nimport withFieldItem from '../withFieldItem';\nimport InputFilterItemField from './InputFilterItem';\nimport NumberRangeFilterItemField from './NumberRangeFilterItem';\nimport withLocale from '../withLocale';\nimport SuperSelect, { SelectCascader, SelectTableList } from '@kne/super-select';\nimport { SelectAddress, SelectFunction, SelectIndustry } from '@kne/super-select-plus';\nimport '@kne/super-select/dist/index.css';\nimport '@kne/super-select-plus/dist/index.css';\n/** SuperSelect / SelectTree 弹层全局修补(选项撑满、checkbox、叶子 switcher-noop) */\nimport '../superSelectPopup.scss';\nimport { renderSelectListItemContent } from '../renderSelectListItemContent';\nimport { defaultSuperSelectEmpty } from '../../Form/superSelectEmpty';\n\nconst withInputDefaultPlaceholder = (WrappedComponent) =>\n withLocale(({ placeholder, label, ...props }) => {\n const { formatMessage } = useIntl({ moduleName: 'Filter' });\n return (\n <WrappedComponent\n {...props}\n label={label}\n placeholder={placeholder || formatMessage({ id: 'defaultInputPlaceholder' }, { label })}\n />\n );\n });\n\n/** 默认超长省略 + title hover;空态中文;业务可传 renderItemContent / empty 覆盖 */\nfunction SuperSelectWithLabelEllipsis({ renderItemContent, empty, ...props }) {\n return (\n <SuperSelect\n {...props}\n empty={empty ?? defaultSuperSelectEmpty()}\n renderItemContent={renderItemContent || renderSelectListItemContent}\n />\n );\n}\n\nexport const InputFilterItem = withInputDefaultPlaceholder(InputFilterItemField);\nexport const NumberRangeFilterItem = withInputDefaultPlaceholder(NumberRangeFilterItemField);\n\nexport { default as DatePickerFilterItem } from './DatePickerFilterItem';\nexport { default as DateRangePickerFilterItem } from './DateRangePickerFilterItem';\nexport { default as TypeDateRangePickerFilterItem } from './TypeDateRangePickerFilterItem';\n\nexport const SuperSelectFilterItem = withFieldItem(SuperSelectWithLabelEllipsis, {\n forcePopup: true,\n});\nexport const SelectTableListFilterItem = withFieldItem(SelectTableList, { forcePopup: true });\nexport { default as SelectTreeFilterItem } from './SelectTreeFilterItem';\nexport const SelectCascaderFilterItem = withFieldItem(SelectCascader, { forcePopup: true });\nexport const SelectFunctionFilterItem = withFieldItem(SelectFunction, { forcePopup: true });\nexport const SelectIndustryFilterItem = withFieldItem(SelectIndustry, { forcePopup: true });\nexport const SelectAddressFilterItem = withFieldItem(SelectAddress, { forcePopup: true });\n"],"names":["withInputDefaultPlaceholder","WrappedComponent","withLocale","placeholder","label","props","formatMessage","useIntl","jsx","SuperSelectWithLabelEllipsis","renderItemContent","empty","SuperSelect","defaultSuperSelectEmpty","renderSelectListItemContent","InputFilterItem","InputFilterItemField","NumberRangeFilterItem","NumberRangeFilterItemField","SuperSelectFilterItem","withFieldItem","SelectTableListFilterItem","SelectTableList","SelectCascaderFilterItem","SelectCascader","SelectFunctionFilterItem","SelectFunction","SelectIndustryFilterItem","SelectIndustry","SelectAddressFilterItem","SelectAddress"],"mappings":";;;;;;;;;;;;;;;;;AAeA,MAAMA,IAA8B,CAACC,MACnCC,EAAW,CAAC,EAAE,aAAAC,GAAa,OAAAC,GAAO,GAAGC,QAAY;AAC/C,QAAM,EAAE,eAAAC,EAAA,IAAkBC,EAAQ,EAAE,YAAY,UAAU;AAC1D,SACE,gBAAAC;AAAA,IAACP;AAAA,IAAA;AAAA,MACE,GAAGI;AAAA,MACJ,OAAAD;AAAA,MACA,aAAaD,KAAeG,EAAc,EAAE,IAAI,0BAAA,GAA6B,EAAE,OAAAF,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAG5F,CAAC;AAGH,SAASK,EAA6B,EAAE,mBAAAC,GAAmB,OAAAC,GAAO,GAAGN,KAAS;AAC5E,SACE,gBAAAG;AAAA,IAACI;AAAA,IAAA;AAAA,MACE,GAAGP;AAAA,MACJ,OAAOM,KAASE,EAAA;AAAA,MAChB,mBAAmBH,KAAqBI;AAAA,IAAA;AAAA,EAAA;AAG9C;AAEO,MAAMC,IAAkBf,EAA4BgB,CAAoB,GAClEC,IAAwBjB,EAA4BkB,CAA0B,GAM9EC,IAAwBC,EAAcX,GAA8B;AAAA,EAC/E,YAAY;AACd,CAAC,GACYY,IAA4BD,EAAcE,GAAiB,EAAE,YAAY,IAAM,GAE/EC,IAA2BH,EAAcI,GAAgB,EAAE,YAAY,IAAM,GAC7EC,IAA2BL,EAAcM,GAAgB,EAAE,YAAY,IAAM,GAC7EC,IAA2BP,EAAcQ,GAAgB,EAAE,YAAY,IAAM,GAC7EC,IAA0BT,EAAcU,GAAe,EAAE,YAAY,IAAM;"}
@@ -0,0 +1,20 @@
1
+ export type CancelExecutionModalProps = {
2
+ open: boolean;
3
+ /** 有目标才真正打开 */
4
+ hasTarget?: boolean;
5
+ confirmLoading?: boolean;
6
+ onCancel: () => void;
7
+ onSubmit: (cancelReason: string) => Promise<void>;
8
+ title?: string;
9
+ okText?: string;
10
+ hint?: string;
11
+ placeholder?: string;
12
+ className?: string;
13
+ };
14
+ export declare function CancelExecutionForm({ hint, placeholder, }: {
15
+ hint?: string;
16
+ placeholder?: string;
17
+ }): import("react").JSX.Element;
18
+ /** 取消执行:须填写理由再提交 */
19
+ declare const CancelExecutionModal: React.FC<CancelExecutionModalProps>;
20
+ export default CancelExecutionModal;
@@ -0,0 +1,82 @@
1
+ import { jsxs as R, jsx as e } from "react/jsx-runtime";
2
+ import { useState as y } from "react";
3
+ import c from "classnames";
4
+ import t from "./CancelExecutionModal.module.scss.js";
5
+ import S from "../../../FormInfo/FormInfo.js";
6
+ import { TextArea as w } from "../../../FormInfo/fields.js";
7
+ import E from "../../../FormInfo/FormModal.js";
8
+ function N({
9
+ hint: o = "取消后任务进入「已取消」;重新打开前须说明原因。",
10
+ placeholder: n = "请填写取消执行的理由"
11
+ }) {
12
+ return /* @__PURE__ */ R("div", { className: c("cancel-execution-form", t["cancel-execution-form"]), children: [
13
+ /* @__PURE__ */ e("p", { className: t["cancel-execution-form-hint"], children: o }),
14
+ /* @__PURE__ */ e(
15
+ S,
16
+ {
17
+ column: 1,
18
+ list: [
19
+ /* @__PURE__ */ e(
20
+ w,
21
+ {
22
+ name: "cancelReason",
23
+ label: "取消理由",
24
+ rule: "REQ",
25
+ rows: 3,
26
+ block: !0,
27
+ placeholder: n
28
+ },
29
+ "cancelReason"
30
+ )
31
+ ]
32
+ }
33
+ )
34
+ ] });
35
+ }
36
+ const A = ({
37
+ open: o,
38
+ hasTarget: n = !0,
39
+ confirmLoading: s,
40
+ onCancel: l,
41
+ onSubmit: i,
42
+ title: m = "取消执行",
43
+ okText: u = "确认取消",
44
+ hint: f,
45
+ placeholder: d,
46
+ className: p
47
+ }) => {
48
+ const [x, r] = y(!1), b = o && n, g = async (h) => {
49
+ const a = String(h.cancelReason ?? "").trim();
50
+ if (!a)
51
+ throw new Error("missing cancelReason");
52
+ r(!0);
53
+ try {
54
+ await i(a);
55
+ } finally {
56
+ r(!1);
57
+ }
58
+ };
59
+ return /* @__PURE__ */ e(
60
+ E,
61
+ {
62
+ className: c("cancel-execution-modal", t["cancel-execution-modal"], p),
63
+ title: m,
64
+ open: b,
65
+ onCancel: l,
66
+ autoClose: !0,
67
+ okText: u,
68
+ okButtonProps: { danger: !0, loading: s || x },
69
+ destroyOnHidden: !0,
70
+ formProps: {
71
+ data: { cancelReason: "" },
72
+ onSubmit: g
73
+ },
74
+ children: /* @__PURE__ */ e(N, { hint: f, placeholder: d })
75
+ }
76
+ );
77
+ };
78
+ export {
79
+ N as CancelExecutionForm,
80
+ A as default
81
+ };
82
+ //# sourceMappingURL=CancelExecutionModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CancelExecutionModal.js","sources":["../../../../../src/components/Tools/ActionTracking/Cancel/CancelExecutionModal.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { FormInfo, FormModal, TextArea } from '../../../FormInfo';\nimport classNames from 'classnames';\nimport styles from './CancelExecutionModal.module.scss';\n\nexport type CancelExecutionModalProps = {\n open: boolean;\n /** 有目标才真正打开 */\n hasTarget?: boolean;\n confirmLoading?: boolean;\n onCancel: () => void;\n onSubmit: (cancelReason: string) => Promise<void>;\n title?: string;\n okText?: string;\n hint?: string;\n placeholder?: string;\n className?: string;\n};\n\nexport function CancelExecutionForm({\n hint = '取消后任务进入「已取消」;重新打开前须说明原因。',\n placeholder = '请填写取消执行的理由',\n}: {\n hint?: string;\n placeholder?: string;\n}) {\n return (\n <div className={classNames('cancel-execution-form', styles['cancel-execution-form'])}>\n <p className={styles['cancel-execution-form-hint']}>{hint}</p>\n <FormInfo\n column={1}\n list={[\n <TextArea\n key=\"cancelReason\"\n name=\"cancelReason\"\n label=\"取消理由\"\n rule=\"REQ\"\n rows={3}\n block\n placeholder={placeholder}\n />,\n ]}\n />\n </div>\n );\n}\n\n/** 取消执行:须填写理由再提交 */\nconst CancelExecutionModal: React.FC<CancelExecutionModalProps> = ({\n open,\n hasTarget = true,\n confirmLoading,\n onCancel,\n onSubmit,\n title = '取消执行',\n okText = '确认取消',\n hint,\n placeholder,\n className,\n}) => {\n const [submitting, setSubmitting] = useState(false);\n const visible = open && hasTarget;\n\n const handleSubmit = async (formData: Record<string, unknown>) => {\n const reason = String(formData.cancelReason ?? '').trim();\n if (!reason) {\n throw new Error('missing cancelReason');\n }\n setSubmitting(true);\n try {\n await onSubmit(reason);\n } finally {\n setSubmitting(false);\n }\n };\n\n return (\n <FormModal\n className={classNames('cancel-execution-modal', styles['cancel-execution-modal'], className)}\n title={title}\n open={visible}\n onCancel={onCancel}\n autoClose\n okText={okText}\n okButtonProps={{ danger: true, loading: confirmLoading || submitting }}\n destroyOnHidden\n formProps={{\n data: { cancelReason: '' },\n onSubmit: handleSubmit,\n }}\n >\n <CancelExecutionForm hint={hint} placeholder={placeholder} />\n </FormModal>\n );\n};\n\nexport default CancelExecutionModal;\n"],"names":["CancelExecutionForm","hint","placeholder","jsxs","classNames","styles","jsx","FormInfo","TextArea","CancelExecutionModal","open","hasTarget","confirmLoading","onCancel","onSubmit","title","okText","className","submitting","setSubmitting","useState","visible","handleSubmit","formData","reason","FormModal"],"mappings":";;;;;;;AAmBO,SAASA,EAAoB;AAAA,EAClC,MAAAC,IAAO;AAAA,EACP,aAAAC,IAAc;AAChB,GAGG;AACD,SACE,gBAAAC,EAAC,SAAI,WAAWC,EAAW,yBAAyBC,EAAO,uBAAuB,CAAC,GACjF,UAAA;AAAA,IAAA,gBAAAC,EAAC,KAAA,EAAE,WAAWD,EAAO,4BAA4B,GAAI,UAAAJ,GAAK;AAAA,IAC1D,gBAAAK;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,QAAQ;AAAA,QACR,MAAM;AAAA,UACJ,gBAAAD;AAAA,YAACE;AAAA,YAAA;AAAA,cAEC,MAAK;AAAA,cACL,OAAM;AAAA,cACN,MAAK;AAAA,cACL,MAAM;AAAA,cACN,OAAK;AAAA,cACL,aAAAN;AAAA,YAAA;AAAA,YANI;AAAA,UAAA;AAAA,QAON;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;AAGA,MAAMO,IAA4D,CAAC;AAAA,EACjE,MAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,MAAAf;AAAA,EACA,aAAAC;AAAA,EACA,WAAAe;AACF,MAAM;AACJ,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAC5CC,IAAUX,KAAQC,GAElBW,IAAe,OAAOC,MAAsC;AAChE,UAAMC,IAAS,OAAOD,EAAS,gBAAgB,EAAE,EAAE,KAAA;AACnD,QAAI,CAACC;AACH,YAAM,IAAI,MAAM,sBAAsB;AAExC,IAAAL,EAAc,EAAI;AAClB,QAAI;AACF,YAAML,EAASU,CAAM;AAAA,IACvB,UAAA;AACE,MAAAL,EAAc,EAAK;AAAA,IACrB;AAAA,EACF;AAEA,SACE,gBAAAb;AAAA,IAACmB;AAAA,IAAA;AAAA,MACC,WAAWrB,EAAW,0BAA0BC,EAAO,wBAAwB,GAAGY,CAAS;AAAA,MAC3F,OAAAF;AAAA,MACA,MAAMM;AAAA,MACN,UAAAR;AAAA,MACA,WAAS;AAAA,MACT,QAAAG;AAAA,MACA,eAAe,EAAE,QAAQ,IAAM,SAASJ,KAAkBM,EAAA;AAAA,MAC1D,iBAAe;AAAA,MACf,WAAW;AAAA,QACT,MAAM,EAAE,cAAc,GAAA;AAAA,QACtB,UAAUI;AAAA,MAAA;AAAA,MAGZ,UAAA,gBAAAhB,EAACN,GAAA,EAAoB,MAAAC,GAAY,aAAAC,EAAA,CAA0B;AAAA,IAAA;AAAA,EAAA;AAGjE;"}
@@ -0,0 +1,7 @@
1
+ const e = {
2
+ "cancel-execution-form-hint": "_cancel-execution-form-hint_1ca3w_1"
3
+ };
4
+ export {
5
+ e as default
6
+ };
7
+ //# sourceMappingURL=CancelExecutionModal.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CancelExecutionModal.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -0,0 +1,3 @@
1
+ export { default as CancelExecutionModal, CancelExecutionForm } from './CancelExecutionModal';
2
+ export { default } from './CancelExecutionModal';
3
+ export type { CancelExecutionModalProps } from './CancelExecutionModal';
@@ -0,0 +1,25 @@
1
+ import { ReactNode } from 'react';
2
+ import { ActionPersonOption, CreateActionDimensionOption, CreateActionLoaders, CreateActionScopeLock, LockedContextField } from './types';
3
+ /** 建单品种下拉页大小(服务端分页) */
4
+ export declare const CREATE_ACTION_VARIETY_PAGE_SIZE = 20;
5
+ export type CreateActionFormProps = {
6
+ scopeLock?: CreateActionScopeLock;
7
+ varietyLabel?: string;
8
+ lockedContext?: LockedContextField[];
9
+ /** F4:任务标题 placeholder(App 注入;禁写死业务文案) */
10
+ titlePlaceholder?: string;
11
+ /** F4:关联指标 placeholder */
12
+ metricPlaceholder?: string;
13
+ dimensionOptions: CreateActionDimensionOption[];
14
+ loaders: CreateActionLoaders;
15
+ emptyAssigneeHint?: string;
16
+ emptyAllocatorHint?: string;
17
+ allocatorPlaceholder?: string;
18
+ assigneePlaceholder?: string;
19
+ onAssigneeOptionsReady?: (options: ActionPersonOption[]) => void;
20
+ onAllocatorOptionsReady?: (options: ActionPersonOption[]) => void;
21
+ };
22
+ export declare function renderPersonOptionLabel(name: string, org: string): ReactNode;
23
+ /** 新建跟踪任务 / 下发任务字段(FormModal + FormInfo);数据经 loaders 注入 */
24
+ declare const CreateActionForm: React.FC<CreateActionFormProps>;
25
+ export default CreateActionForm;
@@ -0,0 +1,257 @@
1
+ import { jsx as a, jsxs as Z } from "react/jsx-runtime";
2
+ import { useState as m, useRef as fe, useMemo as h, useCallback as oe, useEffect as p } from "react";
3
+ import se from "../../../Form/FormDataSync.js";
4
+ import { message as S } from "antd";
5
+ import de from "classnames";
6
+ import W from "./PersonRoleCascaderField.js";
7
+ import { SetFormFields as ce } from "./SetFormFields.js";
8
+ import v from "./CreateActionForm.module.scss.js";
9
+ import { createPagedSuperSelectApi as ge, pagedSuperSelectGetSearchProps as ye, pagedSuperSelectPagination as he } from "../../../Form/createPagedSuperSelectApi.js";
10
+ import { Input as P } from "../../../FormInfo/fields.js";
11
+ import { SuperSelect as b } from "../../../Form/SuperSelect.js";
12
+ import Y from "../../../FormInfo/FormInfo.js";
13
+ import { useFormApi as Se } from "@kne/react-form";
14
+ const F = 20, C = 15e3;
15
+ function I(e, u) {
16
+ return Promise.race([
17
+ e.then(
18
+ (l) => ({ status: "fulfilled", value: l }),
19
+ (l) => ({ status: "rejected", reason: l })
20
+ ),
21
+ new Promise((l) => {
22
+ setTimeout(() => l({ status: "rejected", reason: new Error("timeout") }), u);
23
+ })
24
+ ]);
25
+ }
26
+ function Pe(e) {
27
+ return e == null || e === "" ? "" : Array.isArray(e) ? String(e[0] ?? "").trim() : typeof e == "object" ? String(e.value ?? "").trim() : String(e).trim();
28
+ }
29
+ function Ne(e, u) {
30
+ return u ? /* @__PURE__ */ Z("span", { className: v["assignee-option"], children: [
31
+ /* @__PURE__ */ a("span", { className: v["assignee-option-name"], children: e }),
32
+ /* @__PURE__ */ a("span", { className: v["assignee-option-org"], children: u })
33
+ ] }) : e;
34
+ }
35
+ const je = ({
36
+ scopeLock: e,
37
+ varietyLabel: u,
38
+ lockedContext: l,
39
+ titlePlaceholder: J,
40
+ metricPlaceholder: X,
41
+ dimensionOptions: w,
42
+ loaders: i,
43
+ emptyAssigneeHint: O = "暂无执行人",
44
+ emptyAllocatorHint: R = "暂无分配人",
45
+ allocatorPlaceholder: k = "先选角色,再选分配人",
46
+ assigneePlaceholder: L = "先选角色,再选执行人",
47
+ onAssigneeOptionsReady: f,
48
+ onAllocatorOptionsReady: o
49
+ }) => {
50
+ var H, K, Q, q;
51
+ const V = Se(), [ee, E] = m([]), [te, T] = m([]), [s, U] = m([]), [_, A] = m(!0), [D, N] = m(!1), [j, re] = m(""), [x, B] = m(() => {
52
+ var t;
53
+ return ((t = e == null ? void 0 : e.factory) == null ? void 0 : t.trim()) || "";
54
+ }), d = fe(((H = e == null ? void 0 : e.factory) == null ? void 0 : H.trim()) || ""), y = !!(l && l.length > 0), M = !!((K = e == null ? void 0 : e.factory) != null && K.trim()), c = !!((Q = e == null ? void 0 : e.variety) != null && Q.trim()), ae = !!((q = e == null ? void 0 : e.metric) != null && q.trim()), g = typeof i.loadVarietyPage == "function", G = !!x || c, le = h(() => {
55
+ var r;
56
+ const t = (r = e == null ? void 0 : e.factory) == null ? void 0 : r.trim();
57
+ return !t || s.some((n) => n.value === t) ? s : [{ value: t, label: t }, ...s];
58
+ }, [s, e == null ? void 0 : e.factory]), $ = h(() => {
59
+ if (!g || !i.loadVarietyPage) return;
60
+ const t = i.loadVarietyPage;
61
+ return ge({
62
+ pageSize: F,
63
+ loadPage: (r) => t({
64
+ ...r,
65
+ factory: d.current
66
+ }),
67
+ onError: () => S.error("品种列表加载失败")
68
+ });
69
+ }, [g, i.loadVarietyPage]), ie = h(
70
+ () => ye(F),
71
+ []
72
+ ), ne = h(
73
+ () => he(F),
74
+ []
75
+ ), ue = oe(
76
+ (t) => {
77
+ if (y) return;
78
+ const r = Pe(t.factory);
79
+ if (r === d.current) return;
80
+ const n = d.current;
81
+ d.current = r, B(r), n && r !== n && g && !c && queueMicrotask(() => {
82
+ V.openApi.setFieldValue({ name: "variety" }, "", { runValidate: !1 });
83
+ });
84
+ },
85
+ [V.openApi, g, c, y]
86
+ );
87
+ p(() => {
88
+ var r;
89
+ const t = ((r = e == null ? void 0 : e.factory) == null ? void 0 : r.trim()) || "";
90
+ t && (d.current = t, B(t));
91
+ }, [e == null ? void 0 : e.factory]), p(() => {
92
+ let t = !1;
93
+ return A(!0), Promise.all([
94
+ I(i.loadAssigneeCatalog(), C),
95
+ I(i.loadAllocatorCatalog(), C)
96
+ ]).then(([r, n]) => {
97
+ if (!t)
98
+ if (r.status === "fulfilled" ? (E(r.value.cascadeOptions), f == null || f(r.value.options)) : (S.error("执行人列表加载失败"), E([]), f == null || f([])), n.status === "fulfilled") {
99
+ T(n.value.cascadeOptions), o == null || o(n.value.options);
100
+ const z = i.pickDefaultAllocatorUserId;
101
+ re(z ? z(n.value.options) : "");
102
+ } else
103
+ S.error("分配人列表加载失败"), T([]), o == null || o([]);
104
+ }).finally(() => {
105
+ t || A(!1);
106
+ }), () => {
107
+ t = !0;
108
+ };
109
+ }, []), p(() => {
110
+ if (y || !i.loadFactoryOptions) return;
111
+ let t = !1;
112
+ return N(!0), I(i.loadFactoryOptions(), C).then((r) => {
113
+ t || (r.status === "fulfilled" ? U(r.value) : (S.error("分厂列表加载失败"), U([])));
114
+ }).finally(() => {
115
+ t || N(!1);
116
+ }), () => {
117
+ t = !0;
118
+ };
119
+ }, []);
120
+ const me = y ? (l || []).map((t, r) => /* @__PURE__ */ a(
121
+ P,
122
+ {
123
+ name: `lockedContext_${r}`,
124
+ label: t.label,
125
+ disabled: !0
126
+ },
127
+ `locked-${r}-${t.label}`
128
+ )) : [
129
+ /* @__PURE__ */ a(
130
+ b,
131
+ {
132
+ name: "factory",
133
+ label: "分厂",
134
+ single: !0,
135
+ options: le,
136
+ placeholder: D ? "加载分厂…" : "选择分厂",
137
+ disabled: D || M,
138
+ allowClear: !M
139
+ },
140
+ "factory"
141
+ ),
142
+ g && $ ? /* @__PURE__ */ a(
143
+ b,
144
+ {
145
+ name: "variety",
146
+ label: u || "品种",
147
+ single: !0,
148
+ api: $,
149
+ getSearchProps: ie,
150
+ pagination: ne,
151
+ placeholder: G ? "选择品种" : "请先选择分厂",
152
+ disabled: c || !G,
153
+ allowClear: !c,
154
+ searchPlaceholder: "搜索品种"
155
+ },
156
+ `variety-${x || "none"}`
157
+ ) : /* @__PURE__ */ a(
158
+ b,
159
+ {
160
+ name: "variety",
161
+ label: u || "品种",
162
+ single: !0,
163
+ options: [],
164
+ placeholder: "App 未注入 loadVarietyPage",
165
+ disabled: !0
166
+ },
167
+ "variety"
168
+ ),
169
+ /* @__PURE__ */ a(
170
+ P,
171
+ {
172
+ name: "metric",
173
+ label: "关联指标",
174
+ placeholder: X || "可选",
175
+ maxLength: 40,
176
+ disabled: ae
177
+ },
178
+ "metric"
179
+ )
180
+ ];
181
+ return /* @__PURE__ */ Z("div", { className: de("create-action-form", v["create-action-form"]), children: [
182
+ /* @__PURE__ */ a(se, { onChange: ue }),
183
+ /* @__PURE__ */ a(ce, { patch: { allocatorUserId: j } }),
184
+ /* @__PURE__ */ a(
185
+ Y,
186
+ {
187
+ column: 1,
188
+ gap: 0,
189
+ list: [
190
+ /* @__PURE__ */ a(
191
+ P,
192
+ {
193
+ name: "title",
194
+ label: "任务标题",
195
+ rule: "REQ",
196
+ placeholder: J || "请输入任务标题",
197
+ maxLength: 120
198
+ },
199
+ "title"
200
+ ),
201
+ /* @__PURE__ */ a(
202
+ b,
203
+ {
204
+ name: "dimension",
205
+ label: "任务类型",
206
+ rule: "REQ",
207
+ single: !0,
208
+ options: w,
209
+ placeholder: "选择任务类型"
210
+ },
211
+ "dimension"
212
+ )
213
+ ]
214
+ }
215
+ ),
216
+ /* @__PURE__ */ a(
217
+ W,
218
+ {
219
+ name: "allocatorUserId",
220
+ label: "分配人",
221
+ cascadeOptions: te,
222
+ loading: _,
223
+ emptyHint: R,
224
+ placeholder: k,
225
+ defaultUserId: j
226
+ }
227
+ ),
228
+ /* @__PURE__ */ a(
229
+ W,
230
+ {
231
+ name: "assigneeUserId",
232
+ label: "执行人",
233
+ cascadeOptions: ee,
234
+ loading: _,
235
+ emptyHint: O,
236
+ placeholder: L
237
+ }
238
+ ),
239
+ /* @__PURE__ */ a(
240
+ Y,
241
+ {
242
+ column: 1,
243
+ gap: 0,
244
+ list: [
245
+ /* @__PURE__ */ a(P, { name: "dueDate", label: "截止日期(可选)", type: "date" }, "dueDate"),
246
+ ...me
247
+ ]
248
+ }
249
+ )
250
+ ] });
251
+ };
252
+ export {
253
+ F as CREATE_ACTION_VARIETY_PAGE_SIZE,
254
+ je as default,
255
+ Ne as renderPersonOptionLabel
256
+ };
257
+ //# sourceMappingURL=CreateActionForm.js.map