zy-react-library 2.1.11 → 2.2.0

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 (155) hide show
  1. package/README.md +13 -32
  2. package/components/Cascader/Area/index.d.ts +25 -0
  3. package/components/Cascader/Area/index.js +1 -0
  4. package/components/Cascader/Basic/index.d.ts +31 -0
  5. package/components/Cascader/Basic/index.js +1 -0
  6. package/components/Cascader/Dictionary/index.d.ts +34 -0
  7. package/components/Cascader/Dictionary/index.js +1 -0
  8. package/components/Cascader/Industry/index.d.ts +25 -0
  9. package/components/Cascader/Industry/index.js +1 -0
  10. package/components/Editor/index.d.ts +29 -0
  11. package/components/Editor/index.js +1 -0
  12. package/components/Excel/index.d.ts +22 -0
  13. package/components/Excel/index.js +1 -0
  14. package/components/FormBuilder/FormBuilder.d.ts +66 -0
  15. package/components/FormBuilder/FormBuilder.js +1 -0
  16. package/components/FormBuilder/FormItemsRenderer.d.ts +286 -0
  17. package/components/FormBuilder/FormItemsRenderer.js +1 -0
  18. package/components/FormBuilder/index.d.ts +7 -0
  19. package/components/FormBuilder/index.js +1 -0
  20. package/components/HeaderBack/index.d.ts +18 -0
  21. package/components/HeaderBack/index.js +1 -0
  22. package/components/HeaderBack/index.less +26 -0
  23. package/components/HiddenInfo/gwj/index.d.ts +26 -0
  24. package/components/HiddenInfo/gwj/index.js +1 -0
  25. package/components/Icon/AddIcon/index.d.ts +6 -0
  26. package/components/Icon/AddIcon/index.js +1 -0
  27. package/components/Icon/BackIcon/index.d.ts +6 -0
  28. package/components/Icon/BackIcon/index.js +1 -0
  29. package/components/Icon/DeleteIcon/index.d.ts +6 -0
  30. package/components/Icon/DeleteIcon/index.js +1 -0
  31. package/components/Icon/DownloadIcon/index.d.ts +6 -0
  32. package/components/Icon/DownloadIcon/index.js +1 -0
  33. package/components/Icon/EditIcon/index.d.ts +6 -0
  34. package/components/Icon/EditIcon/index.js +1 -0
  35. package/components/Icon/ExportIcon/index.d.ts +6 -0
  36. package/components/Icon/ExportIcon/index.js +1 -0
  37. package/components/Icon/ImportIcon/index.d.ts +6 -0
  38. package/components/Icon/ImportIcon/index.js +1 -0
  39. package/components/Icon/LocationIcon/index.d.ts +6 -0
  40. package/components/Icon/LocationIcon/index.js +1 -0
  41. package/components/Icon/PrintIcon/index.d.ts +6 -0
  42. package/components/Icon/PrintIcon/index.js +1 -0
  43. package/components/Icon/ResetIcon/index.d.ts +6 -0
  44. package/components/Icon/ResetIcon/index.js +1 -0
  45. package/components/Icon/SearchIcon/index.d.ts +6 -0
  46. package/components/Icon/SearchIcon/index.js +1 -0
  47. package/components/Icon/VideoIcon/index.d.ts +6 -0
  48. package/components/Icon/VideoIcon/index.js +1 -0
  49. package/components/Icon/ViewIcon/index.d.ts +6 -0
  50. package/components/Icon/ViewIcon/index.js +1 -0
  51. package/components/ImportFile/index.d.ts +29 -0
  52. package/components/ImportFile/index.js +1 -0
  53. package/components/LeftTree/Area/index.d.ts +26 -0
  54. package/components/LeftTree/Area/index.js +1 -0
  55. package/components/LeftTree/Basic/index.d.ts +27 -0
  56. package/components/LeftTree/Basic/index.js +1 -0
  57. package/components/LeftTree/Department/Gwj/index.d.ts +31 -0
  58. package/components/LeftTree/Department/Gwj/index.js +1 -0
  59. package/components/LeftTree/Dictionary/index.d.ts +34 -0
  60. package/components/LeftTree/Dictionary/index.js +1 -0
  61. package/components/Map/CesiumMap.js +1 -0
  62. package/components/Map/MapSelector.d.ts +29 -0
  63. package/components/Map/MapSelector.js +1 -0
  64. package/components/Map/h.png +0 -0
  65. package/components/Map/index.d.ts +27 -0
  66. package/components/Map/index.js +1 -0
  67. package/components/Map/index.less +5 -0
  68. package/components/Page/index.d.ts +36 -0
  69. package/components/Page/index.js +1 -0
  70. package/components/Pdf/index.d.ts +22 -0
  71. package/components/Pdf/index.js +1 -0
  72. package/components/Pdf/index.less +3 -0
  73. package/components/PreviewExcel/index.d.ts +18 -0
  74. package/components/PreviewExcel/index.js +1 -0
  75. package/components/PreviewImg/index.d.ts +12 -0
  76. package/components/PreviewImg/index.js +1 -0
  77. package/components/PreviewPdf/index.d.ts +18 -0
  78. package/components/PreviewPdf/index.js +1 -0
  79. package/components/PreviewWord/index.d.ts +18 -0
  80. package/components/PreviewWord/index.js +1 -0
  81. package/components/SeamlessScroll/index.d.ts +51 -0
  82. package/components/SeamlessScroll/index.js +1 -0
  83. package/components/Search/index.d.ts +49 -0
  84. package/components/Search/index.js +1 -0
  85. package/components/Select/Basic/index.d.ts +35 -0
  86. package/components/Select/Basic/index.js +1 -0
  87. package/components/Select/Dictionary/index.d.ts +33 -0
  88. package/components/Select/Dictionary/index.js +1 -0
  89. package/components/Select/Personnel/Gwj/index.d.ts +72 -0
  90. package/components/Select/Personnel/Gwj/index.js +1 -0
  91. package/components/SelectCreate/index.d.ts +29 -0
  92. package/components/SelectCreate/index.js +1 -0
  93. package/components/SelectTree/Area/index.d.ts +25 -0
  94. package/components/SelectTree/Area/index.js +1 -0
  95. package/components/SelectTree/Basic/index.d.ts +35 -0
  96. package/components/SelectTree/Basic/index.js +1 -0
  97. package/components/SelectTree/Department/Gwj/index.d.ts +61 -0
  98. package/components/SelectTree/Department/Gwj/index.js +1 -0
  99. package/components/SelectTree/Dictionary/index.d.ts +34 -0
  100. package/components/SelectTree/Dictionary/index.js +1 -0
  101. package/components/SelectTree/HiddenLevel/Gwj/index.d.ts +32 -0
  102. package/components/SelectTree/HiddenLevel/Gwj/index.js +1 -0
  103. package/components/SelectTree/HiddenPart/Gwj/index.d.ts +38 -0
  104. package/components/SelectTree/HiddenPart/Gwj/index.js +1 -0
  105. package/components/SelectTree/Industry/index.d.ts +25 -0
  106. package/components/SelectTree/Industry/index.js +1 -0
  107. package/components/Signature/index.d.ts +28 -0
  108. package/components/Signature/index.js +1 -0
  109. package/components/Table/index.d.ts +29 -0
  110. package/components/Table/index.js +1 -0
  111. package/components/Table/index.less +14 -0
  112. package/components/TooltipPreviewImg/index.d.ts +6 -0
  113. package/components/TooltipPreviewImg/index.js +1 -0
  114. package/components/Upload/index.d.ts +32 -0
  115. package/components/Upload/index.js +1 -0
  116. package/components/Video/AliPlayer.d.ts +45 -0
  117. package/components/Video/AliPlayer.js +1 -0
  118. package/components/Video/index.d.ts +20 -0
  119. package/components/Video/index.js +1 -0
  120. package/components/Word/index.d.ts +22 -0
  121. package/components/Word/index.js +1 -0
  122. package/css/common.less +35 -0
  123. package/enum/formItemRender/index.d.ts +68 -0
  124. package/enum/formItemRender/index.js +1 -0
  125. package/hooks/useDeleteFile/index.d.ts +22 -0
  126. package/hooks/useDeleteFile/index.js +1 -0
  127. package/hooks/useDictionary/index.d.ts +24 -0
  128. package/hooks/useDictionary/index.js +1 -0
  129. package/hooks/useDownloadBlob/index.d.ts +16 -0
  130. package/hooks/useDownloadBlob/index.js +1 -0
  131. package/hooks/useDownloadFile/index.d.ts +14 -0
  132. package/hooks/useDownloadFile/index.js +1 -0
  133. package/hooks/useGetFile/index.d.ts +49 -0
  134. package/hooks/useGetFile/index.js +1 -0
  135. package/hooks/useGetUrlQuery/index.d.ts +4 -0
  136. package/hooks/useGetUrlQuery/index.js +1 -0
  137. package/hooks/useGetUserInfo/index.d.ts +21 -0
  138. package/hooks/useGetUserInfo/index.js +1 -0
  139. package/hooks/useIdle/index.d.ts +11 -0
  140. package/hooks/useIdle/index.js +1 -0
  141. package/hooks/useImportFile/index.d.ts +16 -0
  142. package/hooks/useImportFile/index.js +1 -0
  143. package/hooks/useIsExistenceDuplicateSelection/index.d.ts +22 -0
  144. package/hooks/useIsExistenceDuplicateSelection/index.js +1 -0
  145. package/hooks/useTable/index.d.ts +75 -0
  146. package/hooks/useTable/index.js +1 -0
  147. package/hooks/useUploadFile/index.d.ts +67 -0
  148. package/hooks/useUploadFile/index.js +1 -0
  149. package/hooks/useUrlQueryCriteria/index.d.ts +8 -0
  150. package/hooks/useUrlQueryCriteria/index.js +1 -0
  151. package/package.json +8 -6
  152. package/regular/index.d.ts +59 -0
  153. package/regular/index.js +1 -0
  154. package/utils/index.d.ts +395 -0
  155. package/utils/index.js +1 -0
@@ -0,0 +1,286 @@
1
+ import type { NamePath } from "@rc-component/form/lib/interface";
2
+ import type { ColProps } from "antd/es/col";
3
+ import type { FormItemProps, Rule } from "antd/es/form";
4
+ import type { FormListFieldData } from "antd/es/form/FormList";
5
+ import type { Gutter } from "antd/es/grid/row";
6
+ import type { CSSProperties, ReactElement, ReactNode } from "react";
7
+ import type { FORM_ITEM_RENDER_TYPE_MAP } from "../../enum/formItemRender";
8
+ import type { DeepPartial } from "./FormBuilder";
9
+
10
+ /**
11
+ * Form.List name 类型
12
+ */
13
+ export type FormListOptionName<Values> = [number, NamePath<Values>];
14
+
15
+ /**
16
+ * Form.List 依赖项类型
17
+ */
18
+ export type FormListOptionDependencies<Values> = NamePath<Values>;
19
+
20
+ /**
21
+ * 选择项数据类型
22
+ */
23
+ export interface OptionItem {
24
+ /** ID字段 */
25
+ bianma?: any;
26
+ /** 名称字段 */
27
+ name?: string | ReactNode;
28
+ /** 是否禁用 */
29
+ disabled?: boolean;
30
+ [key: string]: any;
31
+ }
32
+
33
+ /**
34
+ * 字段键配置
35
+ */
36
+ export interface ItemsFieldConfig {
37
+ /** 值字段的键名,默认 'bianma' */
38
+ valueKey?: string;
39
+ /** 标签字段的键名,默认 'name' */
40
+ labelKey?: string | ((item: Record<string, any>) => ReactNode);
41
+ }
42
+
43
+ /**
44
+ * Form.List 操作项
45
+ */
46
+ export interface FormListOperations<Values = any> {
47
+ /** 当前表单项的数据字段信息 */
48
+ field: FormListFieldData;
49
+ /** 当前项在列表中的索引位置 */
50
+ fieldIndex: number;
51
+ /** 新增方法 */
52
+ add: (defaultValue?: DeepPartial<Values>, insertIndex?: number) => void;
53
+ /** 删除方法 */
54
+ remove: (index: number | number[]) => void;
55
+ /** 移动方法 */
56
+ move: (from: number, to: number) => void;
57
+ }
58
+
59
+ /**
60
+ * Form.List 独有的属性
61
+ */
62
+ export interface FormListUniqueProps<Values = any, AllValues = Values> {
63
+ /** 是否显示新增按钮,默认 true */
64
+ showAddButton?: boolean;
65
+ /** 是否显示删除按钮,默认 true */
66
+ showRemoveButton?: boolean;
67
+ /** 新增按钮的文本,默认 '添加' */
68
+ addButtonText?: string;
69
+ /** 删除按钮的文本,默认 '删除' */
70
+ removeButtonText?: string;
71
+ /** 表单配置项 */
72
+ options: (field: FormListFieldData, fieldIndex: number, operations: FormListOperations<Values>) => FormListOption<Values, AllValues>[];
73
+ /** 点击新增按钮时的默认值 */
74
+ addDefaultValue?: DeepPartial<Values>;
75
+ /** 点击新增按钮时插入的索引位置 */
76
+ addInsertIndex?: number;
77
+ }
78
+
79
+ /**
80
+ * 条件类型辅助工具
81
+ */
82
+ export type WhenTrue<Condition extends boolean, T> = Condition extends true ? never : T;
83
+
84
+ /**
85
+ * 表单配置项属性类型辅助工具
86
+ */
87
+ export type FormOptionProperty<IsOnlyForLabel extends boolean, IsCustomizeRender extends boolean, T> = WhenTrue<IsOnlyForLabel, WhenTrue<IsCustomizeRender, T>>;
88
+
89
+ /**
90
+ * 表单配置项公共字段
91
+ */
92
+ export interface FormOptionBase<
93
+ Values = any,
94
+ AllValues = Values,
95
+ IsOnlyForLabel extends boolean = false,
96
+ IsCustomizeRender extends boolean = false,
97
+ Name = NamePath<Values>,
98
+ Dependencies = NamePath<Values>,
99
+ > {
100
+ /** React 需要的 key,如果传递了唯一的 name,则不需要 */
101
+ key?: string;
102
+ /** 表单项字段名 */
103
+ name?: Name;
104
+ /** 表单项标签 */
105
+ label?: ReactNode;
106
+ /** 占据栅格列数,默认 12 */
107
+ span?: WhenTrue<IsOnlyForLabel, number>;
108
+ /** 是否必填,默认 true,支持函数动态计算 */
109
+ required?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, boolean | ((formValues: AllValues) => boolean)>;
110
+ /** 验证规则 */
111
+ rules?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, Rule | Rule[]>;
112
+ /** 是否使用字符验证限制 */
113
+ useConstraints?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, boolean>;
114
+ /** 占位符文本,默认会根据传入的 render 类型自动判断(请选择、请输入)和 label 组合 */
115
+ placeholder?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, ReactNode>;
116
+ /** 提示信息,传入将在 label 右侧生成图标展示 tooltip */
117
+ tip?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, ReactNode>;
118
+ /** 是否隐藏,默认 false,支持函数动态计算 */
119
+ hidden?: WhenTrue<IsOnlyForLabel, boolean | ((formValues: AllValues) => boolean)>;
120
+ /** 是否自定义渲染,完全交给外部控制渲染,默认 false */
121
+ customizeRender?: IsCustomizeRender;
122
+ /** 传递给 Form.Item 的属性,支持函数动态计算 */
123
+ formItemProps?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, FormItemProps | ((formValues: AllValues) => FormItemProps)>;
124
+ /** label 栅格配置,默认直接使用外层的 labelCol,如果 span 等于 24,是外层的 labelCol.span 一半 */
125
+ labelCol?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, ColProps>;
126
+ /** wrapper 栅格配置,默认 24 - labelCol.span */
127
+ wrapperCol?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, ColProps>;
128
+ /** 是否应该更新(用于表单联动) */
129
+ shouldUpdate?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, boolean | ((prevValues: AllValues, nextValues: AllValues, info: { source?: string }) => boolean)>;
130
+ /** 依赖字段(用于表单联动) */
131
+ dependencies?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, Dependencies[]>;
132
+ /** 是否仅用于保存标签,不渲染到页面上,只在表单中保存数据,默认 false */
133
+ onlyForLabel?: IsOnlyForLabel;
134
+ /** Col 的内联样式,会合并到 Col 的 style 上,支持函数动态计算 */
135
+ colStyle?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, CSSProperties | ((formValues: AllValues) => CSSProperties)>;
136
+ /** Col 内部、Form.Item 之前渲染的标题节点,支持函数动态计算 */
137
+ colTitle?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, ReactNode | ((formValues: AllValues) => ReactNode)>;
138
+ }
139
+
140
+ /**
141
+ * 按 render 类型区分的表单项
142
+ */
143
+ export type FormOptionByRender<
144
+ RenderType extends keyof FORM_ITEM_RENDER_TYPE_MAP,
145
+ Values = any,
146
+ AllValues = Values,
147
+ IsOnlyForLabel extends boolean = false,
148
+ IsCustomizeRender extends boolean = false,
149
+ Name = NamePath<Values>,
150
+ Dependencies = NamePath<Values>,
151
+ > = FormOptionBase<Values, AllValues, IsOnlyForLabel, IsCustomizeRender, Name, Dependencies> & {
152
+ /** 渲染类型(写字面量时 componentProps 会按该类型推导) */
153
+ render: RenderType;
154
+ /** 传递给表单控件的属性,类型由 render 决定 */
155
+ componentProps?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, FORM_ITEM_RENDER_TYPE_MAP[RenderType] | ((formValues: AllValues) => FORM_ITEM_RENDER_TYPE_MAP[RenderType])>;
156
+ /** 选项数据(用于 select、radio、checkbox) */
157
+ items?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, RenderType extends "select" | "radio" | "checkbox" ? OptionItem[] : never>;
158
+ /** 字段键配置 */
159
+ itemsField?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, RenderType extends "select" | "radio" | "checkbox" ? ItemsFieldConfig : never>;
160
+ /** checkbox 的栅格数量,如果不传入不使用栅格,传入才使用 */
161
+ checkboxCol?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, RenderType extends "checkbox" ? number : never>;
162
+ /** Form.List 独有的属性 */
163
+ formListUniqueProps?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, RenderType extends "formList" ? FormListUniqueProps | ((formValues: AllValues) => FormListUniqueProps) : never>;
164
+ /** FormList 每行的内联样式,仅 render 为 formList 时可用,支持函数按行计算 */
165
+ rowStyle?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, RenderType extends "formList" ? CSSProperties | ((field: FormListFieldData, fieldIndex: number) => CSSProperties) : never>;
166
+ /** FormList 每行起始位置渲染的标题节点,仅 render 为 formList 时可用,支持函数按行计算 */
167
+ rowTitle?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, RenderType extends "formList" ? ReactNode | ((field: FormListFieldData, fieldIndex: number) => ReactNode) : never>;
168
+ };
169
+
170
+ /**
171
+ * 不写 render 或 render 为 input 时的表单项(默认按输入框)
172
+ */
173
+ export type FormOptionDefault<
174
+ Values = any,
175
+ AllValues = Values,
176
+ IsOnlyForLabel extends boolean = false,
177
+ IsCustomizeRender extends boolean = false,
178
+ Name = NamePath<Values>,
179
+ Dependencies = NamePath<Values>,
180
+ > = FormOptionBase<Values, AllValues, IsOnlyForLabel, IsCustomizeRender, Name, Dependencies> & {
181
+ /** 渲染类型,默认 input */
182
+ render?: "input" | undefined;
183
+ /** 传递给 Input 的属性 */
184
+ componentProps?: FORM_ITEM_RENDER_TYPE_MAP["input"] | ((formValues: AllValues) => FORM_ITEM_RENDER_TYPE_MAP["input"]);
185
+ /** 选项数据(用于 select、radio、checkbox),input 时不需要 */
186
+ items?: never;
187
+ /** 字段键配置,input 时不需要 */
188
+ itemsField?: never;
189
+ /** checkbox 的栅格数量,input 时不需要 */
190
+ checkboxCol?: never;
191
+ /** Form.List 独有的属性,input 时不需要 */
192
+ formListUniqueProps?: never;
193
+ };
194
+
195
+ /**
196
+ * 自定义渲染时的表单项(render 为 ReactNode 时使用)
197
+ */
198
+ export type FormOptionCustomRender<
199
+ Values = any,
200
+ AllValues = Values,
201
+ IsOnlyForLabel extends boolean = false,
202
+ IsCustomizeRender extends boolean = false,
203
+ Name = NamePath<Values>,
204
+ Dependencies = NamePath<Values>,
205
+ > = FormOptionBase<Values, AllValues, IsOnlyForLabel, IsCustomizeRender, Name, Dependencies> & {
206
+ /** 渲染类型,默认 ReactNode */
207
+ render: ReactNode;
208
+ /** 传递给表单控件的属性,自定义渲染时不需要 */
209
+ componentProps?: never;
210
+ /** 选项数据(用于 select、radio、checkbox),自定义渲染时不需要 */
211
+ items?: never;
212
+ /** 字段键配置,自定义渲染时不需要 */
213
+ itemsField?: never;
214
+ /** checkbox 的栅格数量,自定义渲染时不需要 */
215
+ checkboxCol?: never;
216
+ /** Form.List 独有的属性,自定义渲染时不需要 */
217
+ formListUniqueProps?: never;
218
+ };
219
+
220
+ /**
221
+ * 根据 render 类型映射生成表单项联合类型
222
+ */
223
+ export type FormOptionByRenderUnion<
224
+ Values = any,
225
+ AllValues = Values,
226
+ IsOnlyForLabel extends boolean = false,
227
+ IsCustomizeRender extends boolean = false,
228
+ Name = NamePath<Values>,
229
+ Dependencies = NamePath<Values>,
230
+ > = { [K in keyof FORM_ITEM_RENDER_TYPE_MAP]: FormOptionByRender<K, Values, AllValues, IsOnlyForLabel, IsCustomizeRender, Name, Dependencies> }[keyof FORM_ITEM_RENDER_TYPE_MAP];
231
+
232
+ /**
233
+ * 表单配置项联合类型组合
234
+ */
235
+ export type FormOptionGroup<
236
+ Values = any,
237
+ AllValues = Values,
238
+ Name = NamePath<Values>,
239
+ Dependencies = NamePath<Values>,
240
+ >
241
+ = | FormOptionDefault<Values, AllValues, false, false, Name, Dependencies>
242
+ | FormOptionDefault<Values, AllValues, false, true, Name, Dependencies>
243
+ | FormOptionDefault<Values, AllValues, true, false, Name, Dependencies>
244
+ | FormOptionByRenderUnion<Values, AllValues, false, false, Name, Dependencies>
245
+ | FormOptionByRenderUnion<Values, AllValues, false, true, Name, Dependencies>
246
+ | FormOptionByRenderUnion<Values, AllValues, true, false, Name, Dependencies>
247
+ | FormOptionCustomRender<Values, AllValues, false, false, Name, Dependencies>
248
+ | FormOptionCustomRender<Values, AllValues, false, true, Name, Dependencies>
249
+ | FormOptionCustomRender<Values, AllValues, true, false, Name, Dependencies>;
250
+
251
+ /**
252
+ * 普通表单配置项
253
+ */
254
+ export type FormOption<Values = any, AllValues = Values> = FormOptionGroup<Values, AllValues>;
255
+
256
+ /**
257
+ * Form.List 子项表单配置项
258
+ */
259
+ export type FormListOption<Values = any, AllValues = Values> = FormOptionGroup<Values, AllValues, FormListOptionName<Values>, FormListOptionDependencies<AllValues>>;
260
+
261
+ /**
262
+ * FormItemsRenderer 组件属性
263
+ */
264
+ export interface FormItemsRendererProps<Values = any> {
265
+ /** 表单配置项数组 */
266
+ options: FormOption<Values>[];
267
+ /** 默认栅格占据列数,默认 12 */
268
+ span?: number;
269
+ /** 是否折叠(仅显示前3项),默认 false */
270
+ collapse?: boolean;
271
+ /** 自动生成必填规则,默认 true */
272
+ useAutoGenerateRequired?: boolean;
273
+ /** 初始值,用于在表单未初始化时提供默认值 */
274
+ initialValues?: DeepPartial<Values>;
275
+ /** 栅格间距,继承自 FormBuilder */
276
+ gutter?: Gutter | [Gutter, Gutter];
277
+ /** label 栅格配置,继承自 FormBuilder */
278
+ labelCol?: ColProps;
279
+ }
280
+
281
+ /**
282
+ * 表单项渲染器组件
283
+ */
284
+ declare const FormItemsRenderer: <Values = any>(props: FormItemsRendererProps<Values>) => ReactElement;
285
+
286
+ export default FormItemsRenderer;
@@ -0,0 +1 @@
1
+ import{InfoCircleOutlined as e}from"@ant-design/icons";import{Input as r,DatePicker as t,Form as n,Col as l,Divider as o,Row as s,Button as a,Checkbox as i,Radio as d,Select as p,InputNumber as u,Tooltip as c}from"antd";import m from"dayjs";import{FORM_ITEM_RENDER_ENUM as h}from"../../enum/formItemRender/index.js";import{getDataType as y}from"../../utils/index.js";import{jsx as E,Fragment as f,jsxs as T}from"react/jsx-runtime";const{TextArea:I}=r,{RangePicker:b}=t,v=({options:v,labelCol:A,gutter:R=24,span:w=12,collapse:Y=!1,useAutoGenerateRequired:D=!0,initialValues:C})=>{const N=n.useFormInstance(),M=()=>{const e=N.getFieldsValue();return 0===Object.keys(e).length&&C?C:e},x=e=>"function"==typeof e.componentProps?e.componentProps(M()):e.componentProps||{},P=e=>{const r="function"==typeof e.formItemProps?e.formItemProps(M()):e.formItemProps||{};return((e,r)=>{[h.DATE,h.DATE_MONTH,h.DATE_YEAR,h.DATETIME].includes(e.render)&&(r.getValueFromEvent=(e,r)=>r,r.getValueProps=e=>({value:e?m(e):void 0})),[h.DATE_WEEK].includes(e.render)&&(r.getValueFromEvent=(e,r)=>r,r.getValueProps=e=>({value:e?m(e,"YYYY-wo"):void 0})),[h.DATE_RANGE,h.DATETIME_RANGE].includes(e.render)&&(r.getValueFromEvent=(e,r)=>r,r.getValueProps=e=>({value:Array.isArray(e)?e.map(e=>e?m(e):void 0):void 0}))})(e,r),r},U=e=>"function"==typeof e?e(M()):e??!0,g=e=>{if(e.render===h.DIVIDER)return[];const r=[];switch(e.render||h.INPUT){case h.INPUT:!1!==e.useConstraints&&r.push({max:50,message:"最多输入50字符"});break;case h.TEXTAREA:!1!==e.useConstraints&&r.push({max:500,message:"最多输入500字符"});break;case h.INPUT_NUMBER:case h.NUMBER:!1!==e.useConstraints&&r.push({pattern:/^(\d+)(\.\d{1,2})?$/,message:"请输入正确的数字,最多保留两位小数"}),!1!==e.useConstraints&&r.push({validator:(e,r)=>r&&Math.abs(Number.parseFloat(r))>999999999?Promise.reject("输入数值超出安全范围"):Promise.resolve()});break;case h.INTEGER:!1!==e.useConstraints&&r.push({pattern:/^(\d+)$/,message:"请输入正确的整数"}),!1!==e.useConstraints&&r.push({validator:(e,r)=>r&&Math.abs(Number.parseFloat(r))>999999999?Promise.reject("输入数值超出安全范围"):Promise.resolve()})}if(!D)return e.rules?Array.isArray(e.rules)?[...e.rules,...r]:[e.rules,...r]:r;if(U(e.required)){const t=!e.render||[h.INPUT,h.TEXTAREA,h.INPUT_NUMBER,h.NUMBER,h.INTEGER].includes(e.render);r.push({required:!0,message:`${t?"请输入":"请选择"}${e.label}`})}return e.rules?Array.isArray(e.rules)?[...e.rules,...r]:[e.rules,...r]:r},_=e=>e.key||("Array"===y(e.name)?e.name.join("."):e.name),B=e=>{const r=e.render===h.DIVIDER?24:e.span??w,t=e.labelCol??(24===r?{span:A.span/2}:A);return{span:r,labelCol:t,wrapperCol:e.wrapperCol??{span:24-t.span}}},F=e=>"function"==typeof e.colStyle?e.colStyle(M()):e.colStyle,S=e=>"function"==typeof e.colTitle?e.colTitle(M()):e.colTitle,k=(e,r)=>(e.shouldUpdate??e.dependencies)||(r.shouldUpdate??r.dependencies),L=e=>"function"==typeof e?e(M()):e??!1,V=(e,r)=>({value:e[r.valueKey],label:"function"==typeof r.labelKey?r.labelKey(e):e[r.labelKey],disabled:e.disabled}),G=e=>{const n=x(e),o=(e=>({valueKey:e?.itemsField?.valueKey||"bianma",labelKey:e?.itemsField?.labelKey||"name"}))(e),a=e.render??h.INPUT,c=e.placeholder??`请${[h.INPUT,h.TEXTAREA,h.INPUT_NUMBER,h.NUMBER,h.INTEGER].includes(a)?"输入":"选择"}${e.label}`;switch(a){case h.INPUT:return E(r,{placeholder:c,maxLength:!1!==e.useConstraints?50:9999,...n});case h.TEXTAREA:return E(I,{placeholder:c,maxLength:!1!==e.useConstraints?500:9999,showCount:!0,rows:3,...n});case h.INPUT_NUMBER:case h.NUMBER:case h.INTEGER:return E(u,{placeholder:c,style:{width:"100%"},...n});case h.SELECT:return E(p,{placeholder:c,showSearch:{optionFilterProp:"label"},allowClear:!0,options:(e.items||[]).map(e=>V(e,o)),...n});case h.RADIO:return E(d.Group,{options:(e.items||[]).map(e=>V(e,o)),...n});case h.CHECKBOX:{const r=(e.items||[]).map(e=>V(e,o));return e.checkboxCol?E(i.Group,{...n,children:E(s,{children:r.map(({value:r,label:t,disabled:n})=>E(l,{span:e.checkboxCol,children:E(i,{value:r,disabled:n,children:t})},r))})}):E(i.Group,{options:r,...n})}case h.DATE:return E(t,{placeholder:c,format:"YYYY-MM-DD",style:{width:"100%"},...n});case h.DATE_MONTH:return E(t,{picker:"month",placeholder:c,format:"YYYY-MM",style:{width:"100%"},...n});case h.DATE_YEAR:return E(t,{picker:"year",placeholder:c,format:"YYYY",style:{width:"100%"},...n});case h.DATE_WEEK:return E(t,{picker:"week",placeholder:c,format:"YYYY-wo",style:{width:"100%"},...n});case h.DATE_RANGE:return E(b,{placeholder:[`请选择开始${e.label}`,`请选择结束${e.label}`],format:"YYYY-MM-DD",style:{width:"100%"},...n});case h.DATETIME:return E(t,{showTime:!0,placeholder:c,format:"YYYY-MM-DD HH:mm:ss",style:{width:"100%"},...n});case h.DATETIME_RANGE:return E(b,{showTime:!0,placeholder:[`请选择开始${e.label}`,`请选择结束${e.label}`],format:"YYYY-MM-DD HH:mm:ss",style:{width:"100%"},...n});case h.DIVIDER:return null;default:return a}},$=r=>r.tip?T(f,{children:[r.label,E(c,{title:r.tip,children:E(e,{style:{marginLeft:4,fontSize:12}})})]}):r.label,K=({option:e,style:r,col:t,index:o,preserve:s})=>{const a=P(e);return delete a.dependencies,delete a.shouldUpdate,L(e.hidden)?null:T(l,{span:t.span,style:{...r,...F(e)},children:[S(e),E(n.Item,{name:e.name,label:$(e),rules:g(e),labelCol:t.labelCol,wrapperCol:t.wrapperCol,preserve:s,required:!!D&&" "!==$(e)&&U(e.required),colon:" "!==$(e),...a,children:G(e)})]},_(e)||o)},q=({option:e,style:r,col:t,index:s,preserve:a})=>{const i=x(e);return L(e.hidden)?null:e.customizeRender?E(l,{span:t.span,style:r,children:e.render},_(e)||s):e.onlyForLabel?E(n.Item,{name:e.name,noStyle:!0,preserve:a,children:E("input",{type:"hidden"})},_(e)||s):e.render===h.DIVIDER?E(l,{span:t.span,style:r,children:E(o,{titlePlacement:"start",...i,children:e.label})},_(e)||s):null},j=({option:e,index:r,col:t,style:o})=>{const i=(e=>{const r={showAddButton:!0,showRemoveButton:!0,addButtonText:"添加",removeButtonText:"删除",options:[],addDefaultValue:{},addInsertIndex:void 0};return"function"==typeof e.formListUniqueProps?{...r,...e.formListUniqueProps(M())}:{...r,...e.formListUniqueProps||{}}})(e),d=x(e);return L(e.hidden)?null:T(l,{span:t.span,style:{...o,...F(e)},children:[S(e),E(n.List,{name:e.name,...d,children:(r,{add:t,remove:d,move:p})=>E(f,{children:r.map((r,u)=>{const c=((e,r,t,n,l,o)=>"function"==typeof e?e(r,t,{field:r,fieldIndex:t,add:n,remove:l,move:o}):e??[])(i.options,r,u,t,d,p),m=((e,r,t)=>"function"==typeof e.rowStyle?e.rowStyle(r,t):e.rowStyle)(e,r,u),y=((e,r,t)=>"function"==typeof e.rowTitle?e.rowTitle(r,t):e.rowTitle)(e,r,u);return T(s,{gutter:R,style:m,children:[y,c.map((e,s)=>{const p=B(e),m=P(e),y={option:e,style:o,col:p,index:`${u}_${s}`,preserve:!0};if(k(e,m))return O(y);const f=q(y);return f||(e.render===h.FORM_LIST?j(y):s===(()=>{for(let e=c.length-1;e>=0;e--){const r=c[e];if(!L(r.hidden)&&!r.onlyForLabel&&r.render!==h.FORM_LIST)return e}return-1})()?(delete m.dependencies,delete m.shouldUpdate,T(l,{span:p.span,style:{...o,...F(e)},children:[S(e),E(n.Item,{label:$(e),labelCol:p.labelCol,wrapperCol:p.wrapperCol,preserve:!1,required:!!D&&" "!==$(e)&&U(e.required),colon:" "!==$(e),...m,children:T("div",{style:{display:"flex",gap:10,alignItems:"center",justifyContent:"space-between"},children:[E("div",{style:{flex:1,minWidth:0},children:E(n.Item,{noStyle:!0,rules:g(e),name:e.name,children:G(e)})}),u>=1?i.showRemoveButton&&E(a,{type:"primary",danger:!0,onClick:()=>d(r.name),children:i.removeButtonText}):i.showAddButton&&E(a,{type:"primary",onClick:()=>t(i.addDefaultValue,i.addInsertIndex),children:i.addButtonText})]})})]},_(e)||s)):K(y))})]},r.key)})})})]},_(e)||r)},O=({option:e,index:r,style:t,col:l,preserve:o})=>{const s=P(e);return E(n.Item,{noStyle:!0,preserve:o,shouldUpdate:e.shouldUpdate??s.shouldUpdate,dependencies:e.dependencies??s.dependencies,children:()=>q({option:e,style:t,col:l,index:r,preserve:o})||(e.render===h.FORM_LIST?j({option:e,index:r,col:l,style:t}):K({option:e,style:t,col:l,index:r,preserve:o}))},_(e)||r)};return E(f,{children:v.map((e,r)=>{const t=B(e),n=(e=>Y&&e>=3?{display:"none"}:void 0)(r),l=P(e),o={option:e,style:n,col:t,index:r,preserve:!1};if(k(e,l))return O(o);return q(o)||(e.render===h.FORM_LIST?j(o):K(o))})})};v.displayName="FormItemsRenderer";export{v as default};
@@ -0,0 +1,7 @@
1
+ import type { FormListOption, FormListUniqueProps, FormOption } from "./FormItemsRenderer";
2
+
3
+ import FormBuilder from "./FormBuilder";
4
+
5
+ export type { FormListOption, FormListUniqueProps, FormOption };
6
+
7
+ export default FormBuilder;
@@ -0,0 +1 @@
1
+ import r from"./FormBuilder.js";export{r as default};
@@ -0,0 +1,18 @@
1
+ import type { FC, ReactNode } from "react";
2
+
3
+ export interface HeaderBackProps {
4
+ /** 标题 */
5
+ title: ReactNode;
6
+ /** 历史记录对象,用于返回上一页,默认使用 window.history.back */
7
+ history?: {
8
+ goBack?: () => void;
9
+ [key: string]: any;
10
+ };
11
+ /** 是否显示返回按钮,默认 true */
12
+ previous?: boolean;
13
+ }
14
+
15
+ /** 头部返回组件 */
16
+ declare const HeaderBack: FC<HeaderBackProps>;
17
+
18
+ export default HeaderBack;
@@ -0,0 +1 @@
1
+ import{ArrowLeftOutlined as i}from"@ant-design/icons";import{Divider as e}from"antd";import"./index.less";import{jsx as a,jsxs as r,Fragment as t}from"react/jsx-runtime";function n(n){const{title:c,history:o,previous:s=!0}=n;return a("div",{className:"header-back",children:r("div",{className:"action",children:[s&&r(t,{children:[r("div",{className:"back",onClick:()=>{o?.goBack?o.goBack():window.history.back()},children:[a(i,{style:{fontSize:14}}),a("span",{children:"返回"})]}),a(e,{orientation:"vertical",style:{backgroundColor:"#dcdfe6",marginLeft:15,marginRight:15}})]}),a("div",{className:"title",children:c})]})})}n.displayName="HeaderBack";export{n as default};
@@ -0,0 +1,26 @@
1
+ .header-back {
2
+ padding: 10px 20px;
3
+ border-bottom: 1px solid #dcdfe6;
4
+ margin-bottom: 0;
5
+ position: sticky;
6
+ top: 0;
7
+ background-color: #fff;
8
+ z-index: 9;
9
+
10
+ .action {
11
+ display: flex;
12
+ align-items: center;
13
+
14
+ .back {
15
+ display: flex;
16
+ align-items: center;
17
+ gap: 10px;
18
+ cursor: pointer;
19
+ font-size: 14px;
20
+ }
21
+
22
+ .title {
23
+ font-size: 17px;
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,26 @@
1
+ import type { FC } from "react";
2
+
3
+ /**
4
+ * 组件属性
5
+ */
6
+ export interface HiddenInfoProps {
7
+ /** id,默认取 query.id */
8
+ id?: string;
9
+ /** id 的字段,默认 id */
10
+ idKey?: string;
11
+ /** hiddenId,默认取 query.hiddenId */
12
+ hiddenId?: string;
13
+ /** hiddenId 的字段,默认 hiddenId */
14
+ hiddenIdKey?: string;
15
+ /** 是否是过往记录,后端会返回详细的步骤信息,默认 false */
16
+ history?: boolean;
17
+ /** 获取数据 */
18
+ onGetData?: (data: Record<string, any>) => void;
19
+ }
20
+
21
+ /**
22
+ * 隐患查看组件(港务局版本)
23
+ */
24
+ declare const HiddenInfo: FC<HiddenInfoProps>;
25
+
26
+ export default HiddenInfo;
@@ -0,0 +1 @@
1
+ import{request as e}from"@cqsjjb/jjb-common-lib/http.js";import{Spin as i,Divider as d,Descriptions as l,Space as n,Button as t}from"antd";import a from"dayjs";import{useState as r,useEffect as c}from"react";import{HIDDEN_SOURCE_ENUM as s,HIDDEN_STATE_ENUM as h,HIDDEN_RECTIFICATION_TYPE_ENUM as m}from"zy-react-data/enum/hidden/gwj";import{UPLOAD_FILE_TYPE_ENUM as o}from"zy-react-data/enum/uploadFile";import p from"../../../hooks/useDownloadFile/index.js";import b from"../../../hooks/useGetFile/index.js";import C from"../../../hooks/useGetUrlQuery/index.js";import{getLabelName as f,getFileSuffix as u,getFileName as O}from"../../../utils/index.js";import y from"../../Icon/VideoIcon/index.js";import U from"../../PreviewImg/index.js";import g from"../../PreviewPdf/index.js";import k from"../../Video/index.js";import{jsxs as N,jsx as P,Fragment as T}from"react/jsx-runtime";function j(j){const{id:F="",idKey:R="id",hiddenId:S="",hiddenIdKey:I="hiddenId",history:A=!1,onGetData:D}=j,[L,w]=r({hiddenUserPresetsCO:{},hiddenRectifyUserCO:[],hiddenConfirmUserCO:[],hiddenAcceptUserCO:[],hiddenAcceptQualifiedUserCO:[],hiddenAcceptUnqualifiedUserCO:[],hiddenInspecCO:{},hiddenSpecialList:[],hiddenExtensionList:[]}),[q,x]=r([]),[v,Q]=r([]),[K,Y]=r([]),[M,$]=r([]),[z,E]=r([]),[G,H]=r([]),[B,V]=r(!0),[J,W]=r(!1),{getFile:X}=b(),Z=C(),{loading:_,downloadFile:ee}=p();return c(()=>{(async()=>{e(A?`/hidden/hidden/history/${F||Z[R]}`:`/hidden/hidden/${F||Z[R]}`,"get").then(e=>{if(e.data.hiddenAcceptQualifiedUserCO=[],e.data.hiddenAcceptUnqualifiedUserCO=[],e.data.hiddenAcceptUserCO&&e.data.hiddenAcceptUserCO.length>0)for(let i=0;i<e.data.hiddenAcceptUserCO.length;i++)1===e.data.hiddenAcceptUserCO[i].status?e.data.hiddenAcceptQualifiedUserCO.push(e.data.hiddenAcceptUserCO[i]):e.data.hiddenAcceptUnqualifiedUserCO.push(e.data.hiddenAcceptUserCO[i]);w(e.data),(async e=>{const i=await X({eqType:o[3],eqForeignKey:S||Z[I]});x(i);const d=await X({eqType:o[102],eqForeignKey:S||Z[I]});if(Q(d),e.hiddenRectifyUserCO&&e.hiddenRectifyUserCO.length>0)for(let i=0;i<e.hiddenRectifyUserCO.length;i++){if(e.hiddenRectifyUserCO[i].hiddenUserId){const d=await X({eqType:o[4],eqForeignKey:e.hiddenRectifyUserCO[i].hiddenUserId});Y(e=>[...e,d])}if(1===e.hiddenRectifyUserCO[i].isRectificationScheme&&e.hiddenRectifyUserCO[i].hiddenSchemeCO&&Object.keys(e.hiddenRectifyUserCO[i].hiddenSchemeCO).length>0&&e.hiddenRectifyUserCO[i].hiddenSchemeCO.hiddenSchemeId){const d=await X({eqType:o[8],eqForeignKey:e.hiddenRectifyUserCO[i].hiddenSchemeCO.hiddenSchemeId});$(e=>[...e,d])}}if(e.hiddenAcceptQualifiedUserCO&&e.hiddenAcceptQualifiedUserCO.length>0)for(let i=0;i<e.hiddenAcceptQualifiedUserCO.length;i++)if(e.hiddenAcceptQualifiedUserCO[i].hiddenUserId){const d=await X({eqType:o[5],eqForeignKey:e.hiddenAcceptQualifiedUserCO[i].hiddenUserId});E(e=>[...e,d])}if(e.hiddenInspecCO&&Object.keys(e.hiddenInspecCO).length>0){const e=await X({eqType:o[146],eqForeignKey:S||Z[I]});H(e)}})(e.data),V(!1),D?.(e.data)})})()},[j.id,j.hiddenId]),N("div",{children:[N(i,{spinning:B||_,children:[P(d,{titlePlacement:"start",children:"隐患信息"}),P(l,{bordered:!0,column:1,styles:{label:{width:200}},items:[{label:"隐患来源",children:f({list:s,status:L.source})},{label:"隐患类型",children:L.hiddenTypeName},{label:"隐患级别",children:L.hiddenLevelName},{label:"隐患状态",children:f({list:h,status:L.state})},{label:"隐患描述",children:L.hiddenDesc},...L.hiddenPartName?[{label:"隐患部位",children:L.hiddenPartName}]:[],...(2===L.source||3===L.source)&&L.hiddenCheckListCO&&Object.keys(L.hiddenCheckListCO).length>0?[{label:"风险点(单元)",children:L.hiddenCheckListCO.listRiskPoints},{label:"辨识部位",children:L.hiddenCheckListCO.identifiedLocations},{label:"存在风险",children:L.hiddenCheckListCO.existingRisks},{label:"风险分级",children:L.hiddenCheckListCO.riskLevel},{label:"隐患清单",children:L.hiddenCheckListCO.listName},{label:"检查内容",children:L.hiddenCheckListCO.inspectionContent}]:[],...L.longitude?[{label:"隐患上报位置(经纬度)",children:[L.longitude&&`经度:${L.longitude}`,L.latitude&&`纬度:${L.latitude}`].filter(Boolean).join(" ")}]:[],...L.positionDesc?[{label:"隐患位置描述",children:L.positionDesc}]:[],{label:"隐患发现人",children:L.creatorName},{label:"隐患发现时间",children:a(L.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss")},{label:"整改类型",children:f({list:m,status:L.rectificationType})},{label:"是否相关方",children:f({list:[{bianma:"1",name:"是"},{bianma:"0",name:"否"}],status:L.isRelated})},...1===L.isRelated?[{label:"相关方项目",children:L.projectName}]:[],{label:"隐患图片",children:P(U,{files:q})},...v.length>0?[{label:"隐患视频",children:P(y,{onClick:()=>{W(!0)}})}]:[]]}),L.hiddenUserPresetsCO&&Object.keys(L.hiddenUserPresetsCO).length>0&&N(T,{children:[P(d,{titlePlacement:"start",children:"整改信息(发现人预填)"}),P(l,{bordered:!0,column:1,styles:{label:{width:200}},items:[{label:"整改"+(1===L.isRelated?"单位":"部门"),children:L.hiddenUserPresetsCO.rectifyDeptName},{label:"整改人",children:L.hiddenUserPresetsCO.rectifyUserName},...2===L.rectificationType&&L.hiddenUserPresetsCO.rectifyDeadline?[{label:"整改期限",children:L.hiddenUserPresetsCO.rectifyDeadline?a(L.hiddenUserPresetsCO.rectifyDeadline).format("YYYY-MM-DD"):""}]:[],...1===L.rectificationType?[{label:"验收部门",children:L.hiddenUserPresetsCO.checkDeptName},{label:"验收人",children:L.hiddenUserPresetsCO.checkUserName}]:[]]})]}),L.hiddenConfirmUserCO&&L.hiddenConfirmUserCO.length>0&&N(T,{children:[P(d,{titlePlacement:"start",children:"隐患确认"}),L.hiddenConfirmUserCO.map(e=>P(l,{bordered:!0,column:1,styles:{label:{width:200}},items:[...e.hiddenLevelName&&0!==e.status?[{label:"隐患级别",children:e.hiddenLevelName}]:[],...e.userName?[{label:"隐患确认人",children:e.userName}]:[],...e.rectificationTime?[{label:"隐患确认时间",children:e.rectificationTime}]:[],...e.rectifyDeptName&&0!==e.status?[{label:"整改"+(1===L.isRelated?"单位":"部门"),children:e.rectifyDeptName}]:[],...e.rectifyUserName&&0!==e.status?[{label:"整改人",children:e.rectifyUserName}]:[],...e.rectificationDeadline&&0!==e.status?[{label:"整改完成期限",children:e.rectificationDeadline}]:[],...e.checkDeptName&&0!==e.status?[{label:"验收部门",children:e.checkDeptName}]:[],...e.checkUserName&&0!==e.status?[{label:"验收人",children:e.checkUserName}]:[],...0===e.status?[...e.repulseCause?[{label:"打回意见",children:e.repulseCause}]:[],...e.rectificationTime?[{label:"打回时间",children:e.rectificationTime}]:[]]:[]]},e.id))]}),L.hiddenExtensionList&&L.hiddenExtensionList.length>0&&N(T,{children:[P(d,{titlePlacement:"start",children:"延期信息"}),L.hiddenExtensionList.map(e=>P(l,{bordered:!0,column:1,styles:{label:{width:200}},items:[...e.createTime?[{label:"申请延期日期",children:e.createTime}]:[],...e.delayTime?[{label:"延期日期",children:e.delayTime}]:[],...e.updateName?[{label:"审核人",children:e.updateName}]:[],...e.disposalPlan?[{label:"处置方案",children:e.disposalPlan}]:[],...e.disposalFile?[{label:"处置方案附件",children:"pdf"===u(e.disposalFile)?P(g,{name:O(e.disposalFile),url:e.disposalFile}):N(n,{children:[P("span",{children:O(e.disposalFile)}),P(t,{type:"primary",size:"small",onClick:()=>ee({url:e.disposalFile}),children:"下载"})]})}]:[],{label:"延期审核状态",children:N(T,{children:[1===e.state&&P("span",{children:"待审核"}),2===e.state&&P("span",{children:"审批中"}),3===e.state&&P("span",{children:"已通过"}),4===e.state&&P("span",{children:"已拒绝"}),5===e.state&&P("span",{children:"已撤回"})]})},...3===e.state||4===e.state?[{label:"延期审核时间",children:e.updateTime}]:[]]},e.id))]}),L.hiddenSpecialList&&L.hiddenSpecialList.length>0&&N(T,{children:[P(d,{titlePlacement:"start",children:"特殊处置审核信息"}),L.hiddenSpecialList.map(e=>P(l,{bordered:!0,column:1,styles:{label:{width:200}},items:[...3===e.state||4===e.state?[...e.updateName?[{label:"审核人",children:e.updateName}]:[],...e.updateTime?[{label:"审核时间",children:e.updateTime}]:[]]:[],{label:"无法整改原因",children:e.examine},...3===e.state?[...e.disposalPlan?[{label:"处置方案",children:e.disposalPlan}]:[],...e.disposalFile?[{label:"处置方案附件",children:"pdf"===u(e.disposalFile)?P(g,{name:O(e.disposalFile),url:e.disposalFile}):N(n,{children:[P("span",{children:O(e.disposalFile)}),P(t,{type:"primary",size:"small",onClick:()=>ee({url:e.disposalFile}),children:"下载"})]})}]:[]]:[],...4===e.state?[{label:"是否更换整改负责人",children:e.rectifyUserCO&&Object.keys(e.rectifyUserCO).length>0?"是":"否"},...e.rectifyUserCO&&Object.keys(e.rectifyUserCO).length>0?[{label:"整改负责人",children:e.rectifyUserCO.userName}]:[]]:[],{label:"特殊处置审核状态",children:N(T,{children:[1===e.state&&P("span",{children:"待审核"}),2===e.state&&P("span",{children:"审批中"}),3===e.state&&P("span",{children:"已通过"}),4===e.state&&P("span",{children:"已拒绝"}),5===e.state&&P("span",{children:"已撤回"})]})}]},e.id))]}),L.hiddenRectifyUserCO&&L.hiddenRectifyUserCO.length>0&&N(T,{children:[P(d,{titlePlacement:"start",children:"整改信息"}),L.hiddenRectifyUserCO.map((e,i)=>P(l,{bordered:!0,column:1,styles:{label:{width:200}},items:[...e.deptName?[{label:"整改"+(1===L.isRelated?"单位":"部门"),children:e.deptName}]:[],...e.userName?[{label:"整改人",children:e.userName}]:[],...e.rectificationTime?[{label:"整改时间",children:e.rectificationTime}]:[],...e.descr?[{label:"整改描述",children:e.descr}]:[],...e.investmentFunds?[{label:"投入资金",children:`${e.investmentFunds}元`}]:[],...e.remarks?[{label:"临时安全措施",children:e.remarks}]:[],{label:"整改后图片",children:P(U,{files:K[i]})},{label:"整改方案",children:N(T,{children:[0===e.isRectificationScheme&&P("span",{children:"无"}),1===e.isRectificationScheme&&P("span",{children:"有"})]})},...1===e.isRectificationScheme&&e.hiddenSchemeCO&&Object.keys(e.hiddenSchemeCO).length>0?[{label:"治理标准",children:e.hiddenSchemeCO.governStanDards},{label:"治理方法",children:e.hiddenSchemeCO.governMethod},{label:"经费落实",children:e.hiddenSchemeCO.expenditure},{label:"负责人员",children:e.hiddenSchemeCO.principal},{label:"工时安排",children:e.hiddenSchemeCO.programming},{label:"时限要求",children:e.hiddenSchemeCO.timeLimitFor},{label:"工作要求",children:e.hiddenSchemeCO.jobRequireMent},{label:"其他事项",children:e.hiddenSchemeCO.otherBusiness},{label:"方案图片",children:P(U,{files:M[i]})}]:[]]},e.id))]}),L.hiddenAcceptQualifiedUserCO.length>0?N(T,{children:[P(d,{titlePlacement:"start",children:"验收信息"}),L.hiddenAcceptQualifiedUserCO.map((e,i)=>P(l,{bordered:!0,column:1,styles:{label:{width:200}},items:[{label:"验收部门",children:e.deptName},{label:"验收人",children:e.userName},{label:"验收时间",children:e.rectificationTime},...e.repulseCause?[{label:"验收打回意见",children:e.repulseCause}]:[],{label:"是否合格",children:e.rectificationTime?"合格":""},...e.descr?[{label:"验收描述",children:e.descr}]:[],...z[i]&&z[i].length>0?[{label:"验收图片",children:P(U,{files:z[i]})}]:[]]},e.id))]}):null,L.hiddenAcceptUnqualifiedUserCO.length>0?N(T,{children:[P(d,{titlePlacement:"start",children:"验收打回信息"}),L.hiddenAcceptUnqualifiedUserCO.map(e=>P(l,{bordered:!0,column:1,styles:{label:{width:200}},items:[{label:"验收部门",children:e.deptName},{label:"验收人",children:e.userName},{label:"验收时间",children:e.rectificationTime},{label:"验收打回意见",children:e.repulseCause}]},e.id))]}):null,L.hiddenInspecCO&&Object.keys(L.hiddenInspecCO).length>0?N(T,{children:[P(d,{titlePlacement:"start",children:"安全环保验收信息"}),P(l,{bordered:!0,column:1,styles:{label:{width:200}},items:[{label:"验收人",children:L.hiddenInspecCO.finalCheckOr},{label:"验收时间",children:L.hiddenInspecCO.finalCheckTime},{label:"是否合格",children:1===L.hiddenInspecCO.finalCheck?"合格":"不合格"},{label:"验收描述",children:L.hiddenInspecCO.finalCheckDesc},{label:"验收图片",children:P(U,{files:G})}]})]}):null]}),J&&P(k,{visible:J,source:v[0].url,onCancel:()=>W(!1),title:"隐患视频"})]})}j.displayName="HiddenInfo";export{j as default};
@@ -0,0 +1,6 @@
1
+ import type { AntdIconProps } from "@ant-design/icons/lib/components/AntdIcon";
2
+ import type { FC } from "react";
3
+
4
+ declare const AddIcon: FC<AntdIconProps>;
5
+
6
+ export default AddIcon;
@@ -0,0 +1 @@
1
+ import{PlusOutlined as o}from"@ant-design/icons";import{jsx as t}from"react/jsx-runtime";const r=r=>t(o,{...r});r.displayName="AddIcon";export{r as default};
@@ -0,0 +1,6 @@
1
+ import type { AntdIconProps } from "@ant-design/icons/lib/components/AntdIcon";
2
+ import type { FC } from "react";
3
+
4
+ declare const BackIcon: FC<AntdIconProps>;
5
+
6
+ export default BackIcon;
@@ -0,0 +1 @@
1
+ import{ArrowLeftOutlined as o}from"@ant-design/icons";import{jsx as t}from"react/jsx-runtime";const a=a=>t(o,{...a});a.displayName="BackIcon";export{a as default};
@@ -0,0 +1,6 @@
1
+ import type { AntdIconProps } from "@ant-design/icons/lib/components/AntdIcon";
2
+ import type { FC } from "react";
3
+
4
+ declare const DeleteIcon: FC<AntdIconProps>;
5
+
6
+ export default DeleteIcon;
@@ -0,0 +1 @@
1
+ import{DeleteOutlined as e}from"@ant-design/icons";import{jsx as t}from"react/jsx-runtime";const o=o=>t(e,{...o});o.displayName="DeleteIcon";export{o as default};
@@ -0,0 +1,6 @@
1
+ import type { AntdIconProps } from "@ant-design/icons/lib/components/AntdIcon";
2
+ import type { FC } from "react";
3
+
4
+ declare const DownloadIcon: FC<AntdIconProps>;
5
+
6
+ export default DownloadIcon;
@@ -0,0 +1 @@
1
+ import{DownloadOutlined as o}from"@ant-design/icons";import{jsx as t}from"react/jsx-runtime";const a=a=>t(o,{...a});a.displayName="DownloadIcon";export{a as default};
@@ -0,0 +1,6 @@
1
+ import type { AntdIconProps } from "@ant-design/icons/lib/components/AntdIcon";
2
+ import type { FC } from "react";
3
+
4
+ declare const EditIcon: FC<AntdIconProps>;
5
+
6
+ export default EditIcon;
@@ -0,0 +1 @@
1
+ import{EditOutlined as t}from"@ant-design/icons";import{jsx as o}from"react/jsx-runtime";const i=i=>o(t,{...i});i.displayName="EditIcon";export{i as default};
@@ -0,0 +1,6 @@
1
+ import type { AntdIconProps } from "@ant-design/icons/lib/components/AntdIcon";
2
+ import type { FC } from "react";
3
+
4
+ declare const ExportIcon: FC<AntdIconProps>;
5
+
6
+ export default ExportIcon;
@@ -0,0 +1 @@
1
+ import{ExportOutlined as o}from"@ant-design/icons";import{jsx as t}from"react/jsx-runtime";const r=r=>t(o,{...r});r.displayName="ExportIcon";export{r as default};
@@ -0,0 +1,6 @@
1
+ import type { AntdIconProps } from "@ant-design/icons/lib/components/AntdIcon";
2
+ import type { FC } from "react";
3
+
4
+ declare const ImportIcon: FC<AntdIconProps>;
5
+
6
+ export default ImportIcon;
@@ -0,0 +1 @@
1
+ import{ImportOutlined as o}from"@ant-design/icons";import{jsx as t}from"react/jsx-runtime";const r=r=>t(o,{...r});r.displayName="ImportIcon";export{r as default};
@@ -0,0 +1,6 @@
1
+ import type { AntdIconProps } from "@ant-design/icons/lib/components/AntdIcon";
2
+ import type { FC } from "react";
3
+
4
+ declare const LocationIcon: FC<AntdIconProps>;
5
+
6
+ export default LocationIcon;
@@ -0,0 +1 @@
1
+ import{EnvironmentOutlined as o}from"@ant-design/icons";import{jsx as t}from"react/jsx-runtime";const a=a=>t(o,{...a});a.displayName="LocationIcon";export{a as default};
@@ -0,0 +1,6 @@
1
+ import type { AntdIconProps } from "@ant-design/icons/lib/components/AntdIcon";
2
+ import type { FC } from "react";
3
+
4
+ declare const PrintIcon: FC<AntdIconProps>;
5
+
6
+ export default PrintIcon;
@@ -0,0 +1 @@
1
+ import{PrinterOutlined as t}from"@ant-design/icons";import{jsx as o}from"react/jsx-runtime";const r=r=>o(t,{...r});r.displayName="PrintIcon";export{r as default};
@@ -0,0 +1,6 @@
1
+ import type { AntdIconProps } from "@ant-design/icons/lib/components/AntdIcon";
2
+ import type { FC } from "react";
3
+
4
+ declare const ResetIcon: FC<AntdIconProps>;
5
+
6
+ export default ResetIcon;
@@ -0,0 +1 @@
1
+ import{ReloadOutlined as t}from"@ant-design/icons";import{jsx as e}from"react/jsx-runtime";const o=o=>e(t,{...o});o.displayName="ResetIcon";export{o as default};
@@ -0,0 +1,6 @@
1
+ import type { AntdIconProps } from "@ant-design/icons/lib/components/AntdIcon";
2
+ import type { FC } from "react";
3
+
4
+ declare const SearchIcon: FC<AntdIconProps>;
5
+
6
+ export default SearchIcon;
@@ -0,0 +1 @@
1
+ import{SearchOutlined as o}from"@ant-design/icons";import{jsx as r}from"react/jsx-runtime";const t=t=>r(o,{...t});t.displayName="SearchIcon";export{t as default};
@@ -0,0 +1,6 @@
1
+ import type { AntdIconProps } from "@ant-design/icons/lib/components/AntdIcon";
2
+ import type { FC } from "react";
3
+
4
+ declare const VideoIcon: FC<AntdIconProps>;
5
+
6
+ export default VideoIcon;
@@ -0,0 +1 @@
1
+ import{PlayCircleOutlined as o}from"@ant-design/icons";import{jsx as t}from"react/jsx-runtime";const e=e=>t(o,{...e});e.displayName="VideoIcon";export{e as default};
@@ -0,0 +1,6 @@
1
+ import type { AntdIconProps } from "@ant-design/icons/lib/components/AntdIcon";
2
+ import type { FC } from "react";
3
+
4
+ declare const ViewIcon: FC<AntdIconProps>;
5
+
6
+ export default ViewIcon;
@@ -0,0 +1 @@
1
+ import{EyeOutlined as o}from"@ant-design/icons";import{jsx as t}from"react/jsx-runtime";const e=e=>t(o,{...e});e.displayName="ViewIcon";export{e as default};
@@ -0,0 +1,29 @@
1
+ import type { FormInstance, FormProps } from "antd/es/form";
2
+ import type { UploadFile } from "antd/es/upload";
3
+ import type { FC, ReactNode } from "react";
4
+
5
+ export interface ImportFileProps extends Omit<FormProps, "form"> {
6
+ /** 弹窗是否显示 */
7
+ visible: boolean;
8
+ /** 弹窗标题 */
9
+ title?: string;
10
+ /** 模板文件地址 */
11
+ templateUrl?: string;
12
+ /** 子组件 */
13
+ children?: ReactNode | ((props: { form: FormInstance }) => ReactNode);
14
+ /** 确认回调 */
15
+ onConfirm: (values: { file?: UploadFile[]; [key: string]: any }) => void;
16
+ /** 取消回调 */
17
+ onCancel: () => void;
18
+ /** 导出模板按钮文字,默认 “导出模板” */
19
+ exportTemplateButtonText?: ReactNode;
20
+ /** 额外按钮 */
21
+ extraButtons?: ReactNode;
22
+ }
23
+
24
+ /**
25
+ * 导入文件组件
26
+ */
27
+ declare const ImportFile: FC<ImportFileProps>;
28
+
29
+ export default ImportFile;
@@ -0,0 +1 @@
1
+ import{Form as e,Modal as t,Button as o}from"antd";import{getFileUrl as l}from"../../utils/index.js";import n from"../Upload/index.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";const s=s=>{const{visible:a,onCancel:c,onConfirm:m,title:p="导入",templateUrl:d,labelCol:x={span:4},children:f,exportTemplateButtonText:u="导出模板",extraButtons:C,...h}=s,[b]=e.useForm(),k=()=>{b.resetFields(),c()};return r(t,{title:p,open:a,onCancel:k,width:600,mask:{closable:!1},footer:[d&&r(o,{onClick:()=>{t.confirm({title:"提示",content:"确定要下载excel模板吗?",okText:"确定",cancelText:"取消",onOk:()=>{const e=l();window.open(e+d)}})},children:u},"export"),...C||[],r(o,{onClick:k,children:"取消"},"cancel"),r(o,{type:"primary",onClick:b.submit,children:"确定"},"submit")],children:i(e,{form:b,labelCol:x,wrapperCol:{span:24-x.span},scrollToFirstError:!0,onFinish:e=>{m(e),k()},...h,children:[f&&"function"==typeof f?f({form:b}):f,r(e.Item,{label:"附件",name:"file",rules:[{required:!0,message:"附件不能为空"}],children:r(n,{accept:".xls,.xlsx",listType:"text",maxCount:1})})]})})};s.displayName="ImportFile";export{s as default};
@@ -0,0 +1,26 @@
1
+ import type { FC } from "react";
2
+ import type { BasicLeftTreeProps } from "../Basic";
3
+
4
+ export interface AreaLeftTreeItem {
5
+ value: string;
6
+ label: string;
7
+ children: AreaLeftTreeItem[];
8
+ [key: string]: any;
9
+ }
10
+
11
+ /**
12
+ * 组件属性
13
+ */
14
+ export interface AreaLeftTreeProps extends Omit<BasicLeftTreeProps, "treeData" | "nameKey" | "idKey" | "childrenKey" | "onGetNodePaths" | "onGetData"> {
15
+ /** 获取父级节点 */
16
+ onGetNodePaths?: (nodes: AreaLeftTreeItem[]) => void;
17
+ /** 获取数据 */
18
+ onGetData?: (data: AreaLeftTreeItem[], processedData: AreaLeftTreeItem[]) => void;
19
+ }
20
+
21
+ /**
22
+ * 属地左侧树组件
23
+ */
24
+ declare const AreaLeftTree: FC<AreaLeftTreeProps>;
25
+
26
+ export default AreaLeftTree;