@donglegeyu/company-ui 2.1.0 → 2.3.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.
@@ -4,7 +4,7 @@
4
4
  align-items: center;
5
5
  height: 38px;
6
6
  padding: 8px 0;
7
- margin-bottom: 8px;
7
+ margin-bottom: 0;
8
8
  }
9
9
 
10
10
  .section-title-head {
@@ -7,29 +7,44 @@ export interface DrawerDetailTab {
7
7
  label: ReactNode;
8
8
  content: ReactNode;
9
9
  }
10
+ /** 顶部核心区的关键字段行(label + value 纯文字行,对齐设计稿) */
11
+ export interface DrawerDetailField {
12
+ label: ReactNode;
13
+ value: ReactNode;
14
+ }
10
15
  export interface DrawerDetailTemplateProps extends Omit<DrawerProps, "onClose" | "footer" | "destroyOnClose" | "maskClosable"> {
11
- /** 抽屉是否打开 */
16
+ /** 抽屉标题(Head 行 16px/600,含关闭图标) */
17
+ title?: ReactNode;
18
+ /** 是否打开 */
12
19
  open: boolean;
13
20
  /** 关闭回调 */
14
21
  onClose: () => void;
15
- /** 抽屉标题(顶部核心区标题) */
16
- title?: ReactNode;
17
- /** 抽屉宽度(业务约定详情抽屉默认 640;表单抽屉 DrawerFormTemplate 为 440) */
22
+ /** 24px 大标题(Head 下方内容区首行,与 tags/actions 同行) */
23
+ name?: ReactNode;
24
+ /** 大标题右侧的状态标签(CompanyTag 数组或自定义 ReactNode) */
25
+ tags?: ReactNode;
26
+ /** 大标题行最右侧的操作区(如「编辑」主按钮),与标题解耦 */
27
+ titleActions?: ReactNode;
28
+ /** 大标题下方的关键字段行(label 45% 灰 + value 88% 黑,行距 4px) */
29
+ fields?: DrawerDetailField[];
30
+ /** 抽屉宽度(业务约定详情抽屉默认 440,对齐设计稿;表单抽屉同为 440) */
18
31
  width?: number | string;
19
32
  /**
20
33
  * 点击遮罩是否关闭;详情为只读、无填写内容会丢失,业务约定默认 true。
21
34
  * 与 DrawerFormTemplate 的默认 false 相反(表单有未保存数据,误触会丢失)。
22
35
  */
23
36
  maskClosable?: boolean;
24
- /** 顶部核心区内容(状态标签、关键字段等),固定在抽屉顶部、不随内容滚动 */
37
+ /** 自定义顶部核心区内容(传入后替代内置 name/tags/titleActions/fields 结构) */
25
38
  headerContent?: ReactNode;
26
- /** 顶部核心区副标题/说明文字 */
39
+ /** 顶部核心区底部是否显示分割线;Tab 模式下 TabBar 自带分割线,可设为 false 避免双线 */
40
+ headerDivider?: boolean;
41
+ /** 顶部核心区副标题/说明文字(内置结构时渲染在 fields 下方、分割线上方) */
27
42
  description?: ReactNode;
28
43
  /** 内容区分 Tab 配置;不传则直接渲染 children */
29
44
  tabs?: DrawerDetailTab[];
30
45
  /** 受控当前 Tab */
31
46
  activeTabKey?: string;
32
- /** 非受控默认 Tab */
47
+ /** 非受控 defaultActiveKey */
33
48
  defaultActiveTabKey?: string;
34
49
  /** Tab 切换回调 */
35
50
  onTabChange?: (key: string) => void;
@@ -33,9 +33,14 @@ var DrawerDetailTemplateInner = ({
33
33
  open,
34
34
  onClose,
35
35
  title,
36
- width = 640,
36
+ name,
37
+ tags,
38
+ titleActions,
39
+ fields,
40
+ width = 440,
37
41
  maskClosable = true,
38
42
  headerContent,
43
+ headerDivider = true,
39
44
  description,
40
45
  tabs,
41
46
  activeTabKey,
@@ -47,9 +52,9 @@ var DrawerDetailTemplateInner = ({
47
52
  styles,
48
53
  ...rest
49
54
  }, ref) => {
50
- const { token } = import_antd.theme.useToken();
51
55
  const isPresent = (value) => value !== void 0 && value !== null;
52
- const hasHeader = isPresent(headerContent) || isPresent(description);
56
+ const hasStructuredHeader = isPresent(name) || isPresent(tags) || isPresent(titleActions) || fields && fields.length > 0;
57
+ const hasHeader = hasStructuredHeader || isPresent(headerContent) || isPresent(description);
53
58
  const mergedClassNames = (info) => {
54
59
  const base = typeof classNames === "function" ? classNames(info) : classNames;
55
60
  return {
@@ -58,47 +63,55 @@ var DrawerDetailTemplateInner = ({
58
63
  };
59
64
  };
60
65
  const bodyNode = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "drawer-detail-template", ref, children: [
61
- hasHeader ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
66
+ hasHeader ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
62
67
  "div",
63
68
  {
64
- className: "drawer-detail-template__header",
65
- style: {
66
- padding: `${token.paddingMD}px ${token.paddingLG}px`
67
- },
68
- children: [
69
- headerContent,
70
- isPresent(description) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
71
- "div",
72
- {
73
- className: "drawer-detail-template__description",
74
- style: { marginTop: token.marginXS },
75
- children: description
76
- }
77
- ) : null
78
- ]
69
+ className: `drawer-detail-template__header${headerDivider ? "" : " drawer-detail-template__header--no-divider"}`,
70
+ children: headerContent ?? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "drawer-detail-template__header-inner", children: [
71
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "drawer-detail-template__name-row", children: [
72
+ isPresent(name) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "drawer-detail-template__name", children: name }) : null,
73
+ tags,
74
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "drawer-detail-template__name-spacer" }),
75
+ isPresent(titleActions) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "drawer-detail-template__title-actions", children: titleActions }) : null
76
+ ] }),
77
+ fields && fields.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "drawer-detail-template__fields", children: fields.map((field, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "drawer-detail-template__field", children: [
78
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "drawer-detail-template__field-label", children: [
79
+ field.label,
80
+ ":"
81
+ ] }),
82
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "drawer-detail-template__field-value", children: field.value ?? "--" })
83
+ ] }, index)) }) : null,
84
+ isPresent(description) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "drawer-detail-template__description", children: description }) : null
85
+ ] })
79
86
  }
80
87
  ) : null,
81
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "drawer-detail-template__content", children: tabs && tabs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
82
- import_basic_components.CompanyTabs,
88
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
89
+ "div",
83
90
  {
84
- className: "drawer-detail-template__tabs",
85
- activeKey: activeTabKey,
86
- defaultActiveKey: defaultActiveTabKey ?? tabs[0].key,
87
- onChange: onTabChange,
88
- items: tabs.map((tab) => ({
89
- key: tab.key,
90
- label: tab.label,
91
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { padding: token.paddingLG }, children: tab.content })
92
- }))
91
+ className: `drawer-detail-template__content${tabs && tabs.length > 0 ? " drawer-detail-template__content--tabs" : ""}`,
92
+ children: tabs && tabs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
93
+ import_basic_components.CompanyTabs,
94
+ {
95
+ className: "drawer-detail-template__tabs",
96
+ activeKey: activeTabKey,
97
+ defaultActiveKey: defaultActiveTabKey ?? tabs[0].key,
98
+ onChange: onTabChange,
99
+ items: tabs.map((tab) => ({
100
+ key: tab.key,
101
+ label: tab.label,
102
+ children: tab.content
103
+ }))
104
+ }
105
+ ) : children
93
106
  }
94
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { padding: token.paddingLG }, children }) })
107
+ )
95
108
  ] });
96
109
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.ConfigProvider, { theme: import_theme.companyTheme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
97
110
  import_basic_components.CompanyDrawer,
98
111
  {
99
112
  open,
100
113
  title,
101
- width,
114
+ size: width,
102
115
  onClose,
103
116
  maskClosable,
104
117
  footer: footer ?? null,
@@ -1,6 +1,6 @@
1
1
  // 抽屉 body 改为 flex 容器且禁止整体滚动——顶部核心区固定、下方内容区滚动
2
- .drawer-detail-template__drawer-body {
3
- padding: 0;
2
+ // 特异性 (0,3,0) 覆盖 antd (.ant-drawer .ant-drawer-body) (0,2,0);padding 恢复 antd 默认 24px
3
+ .ant-drawer .ant-drawer-body.drawer-detail-template__drawer-body {
4
4
  display: flex;
5
5
  flex-direction: column;
6
6
  overflow: hidden;
@@ -19,15 +19,86 @@
19
19
  background: var(--color-bg-container);
20
20
  }
21
21
 
22
+ // Tab 模式下 TabBar 自带底部分割线,去掉 header 的避免双线
23
+ &__header--no-divider {
24
+ border-bottom: 0;
25
+ }
26
+
27
+ // 内置结构化头部:底部留 24px(分割线上方间距)
28
+ &__header-inner {
29
+ padding-bottom: 24px;
30
+ }
31
+
32
+ // 大标题行:24px/600 大标题 + 状态 Tag + 弹性占位 + 操作按钮
33
+ &__name-row {
34
+ display: flex;
35
+ align-items: center;
36
+ gap: 8px;
37
+ margin-bottom: 12px;
38
+ }
39
+
40
+ &__name {
41
+ font-size: 24px;
42
+ font-weight: 600;
43
+ line-height: 32px;
44
+ color: rgba(0, 0, 0, 0.88);
45
+ }
46
+
47
+ &__name-spacer {
48
+ flex: 1;
49
+ }
50
+
51
+ &__title-actions {
52
+ display: flex;
53
+ align-items: center;
54
+ gap: 8px;
55
+ }
56
+
57
+ // 关键字段行:label 45% 灰 + value 88% 黑,行间 gap 4px(对齐设计稿)
58
+ &__fields {
59
+ display: flex;
60
+ flex-direction: column;
61
+ gap: 4px;
62
+ }
63
+
64
+ &__field {
65
+ display: flex;
66
+ align-items: baseline;
67
+ line-height: 22px;
68
+ font-size: 14px;
69
+ }
70
+
71
+ &__field-label {
72
+ color: rgba(0, 0, 0, 0.45);
73
+ white-space: nowrap;
74
+ }
75
+
76
+ &__field-value {
77
+ color: rgba(0, 0, 0, 0.88);
78
+ word-break: break-all;
79
+ }
80
+
22
81
  &__description {
82
+ margin-top: 12px;
23
83
  color: var(--color-text-tertiary);
24
84
  }
25
85
 
26
- // 内容区:唯一滚动区域
86
+ // 内容区:唯一滚动区域(顶部留 24px,对齐 header 分割线下方间距)
27
87
  &__content {
28
88
  flex: 1;
29
89
  min-height: 0;
30
90
  overflow: auto;
91
+ padding-top: 24px;
92
+ }
93
+
94
+ // Tab 模式:TabBar 紧贴 header,无上间距
95
+ &__content--tabs {
96
+ padding-top: 0;
97
+ }
98
+
99
+ // 内容区垂直 Space(size="small")行间距由 antd 默认 8px 提到 16px,贴合详情排版
100
+ .ant-space-gap-row-small {
101
+ row-gap: 16px;
31
102
  }
32
103
 
33
104
  // Tab 模式:tabBar 固定在内容区顶部,仅 pane 内容滚动
@@ -38,8 +109,12 @@
38
109
 
39
110
  .ant-tabs-nav {
40
111
  flex-shrink: 0;
41
- margin-bottom: 0;
42
- border-bottom: 1px solid var(--color-border-secondary);
112
+ margin-bottom: 16px;
113
+ }
114
+
115
+ // antd 分割线 ::before 紧贴 tab 文字底部,线下方 16px 才是页签内容(margin 放 nav 上,避免撑高导致线错位)
116
+ .ant-tabs-nav-wrap {
117
+ padding-bottom: 0;
43
118
  }
44
119
 
45
120
  .ant-tabs-content-holder {
@@ -7,7 +7,7 @@ export { default as FormPageTemplate } from "./FormPageTemplate";
7
7
  export { default as DrawerFormTemplate } from "./DrawerFormTemplate";
8
8
  export type { DrawerFormTemplateProps } from "./DrawerFormTemplate";
9
9
  export { default as DrawerDetailTemplate } from "./DrawerDetailTemplate";
10
- export type { DrawerDetailTemplateProps, DrawerDetailTab } from "./DrawerDetailTemplate";
10
+ export type { DrawerDetailTemplateProps, DrawerDetailTab, DrawerDetailField, } from "./DrawerDetailTemplate";
11
11
  export { default as DetailPageTemplate } from "./DetailPageTemplate";
12
12
  export type { DetailFieldItem, DetailTagItem, DetailTabItem } from "./DetailPageTemplate";
13
13
  export { default as IconSelect } from "./IconSelect";
@@ -4,7 +4,7 @@
4
4
  align-items: center;
5
5
  height: 38px;
6
6
  padding: 8px 0;
7
- margin-bottom: 8px;
7
+ margin-bottom: 0;
8
8
  }
9
9
 
10
10
  .section-title-head {
@@ -7,29 +7,44 @@ export interface DrawerDetailTab {
7
7
  label: ReactNode;
8
8
  content: ReactNode;
9
9
  }
10
+ /** 顶部核心区的关键字段行(label + value 纯文字行,对齐设计稿) */
11
+ export interface DrawerDetailField {
12
+ label: ReactNode;
13
+ value: ReactNode;
14
+ }
10
15
  export interface DrawerDetailTemplateProps extends Omit<DrawerProps, "onClose" | "footer" | "destroyOnClose" | "maskClosable"> {
11
- /** 抽屉是否打开 */
16
+ /** 抽屉标题(Head 行 16px/600,含关闭图标) */
17
+ title?: ReactNode;
18
+ /** 是否打开 */
12
19
  open: boolean;
13
20
  /** 关闭回调 */
14
21
  onClose: () => void;
15
- /** 抽屉标题(顶部核心区标题) */
16
- title?: ReactNode;
17
- /** 抽屉宽度(业务约定详情抽屉默认 640;表单抽屉 DrawerFormTemplate 为 440) */
22
+ /** 24px 大标题(Head 下方内容区首行,与 tags/actions 同行) */
23
+ name?: ReactNode;
24
+ /** 大标题右侧的状态标签(CompanyTag 数组或自定义 ReactNode) */
25
+ tags?: ReactNode;
26
+ /** 大标题行最右侧的操作区(如「编辑」主按钮),与标题解耦 */
27
+ titleActions?: ReactNode;
28
+ /** 大标题下方的关键字段行(label 45% 灰 + value 88% 黑,行距 4px) */
29
+ fields?: DrawerDetailField[];
30
+ /** 抽屉宽度(业务约定详情抽屉默认 440,对齐设计稿;表单抽屉同为 440) */
18
31
  width?: number | string;
19
32
  /**
20
33
  * 点击遮罩是否关闭;详情为只读、无填写内容会丢失,业务约定默认 true。
21
34
  * 与 DrawerFormTemplate 的默认 false 相反(表单有未保存数据,误触会丢失)。
22
35
  */
23
36
  maskClosable?: boolean;
24
- /** 顶部核心区内容(状态标签、关键字段等),固定在抽屉顶部、不随内容滚动 */
37
+ /** 自定义顶部核心区内容(传入后替代内置 name/tags/titleActions/fields 结构) */
25
38
  headerContent?: ReactNode;
26
- /** 顶部核心区副标题/说明文字 */
39
+ /** 顶部核心区底部是否显示分割线;Tab 模式下 TabBar 自带分割线,可设为 false 避免双线 */
40
+ headerDivider?: boolean;
41
+ /** 顶部核心区副标题/说明文字(内置结构时渲染在 fields 下方、分割线上方) */
27
42
  description?: ReactNode;
28
43
  /** 内容区分 Tab 配置;不传则直接渲染 children */
29
44
  tabs?: DrawerDetailTab[];
30
45
  /** 受控当前 Tab */
31
46
  activeTabKey?: string;
32
- /** 非受控默认 Tab */
47
+ /** 非受控 defaultActiveKey */
33
48
  defaultActiveTabKey?: string;
34
49
  /** Tab 切换回调 */
35
50
  onTabChange?: (key: string) => void;
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["open", "onClose", "title", "width", "maskClosable", "headerContent", "description", "tabs", "activeTabKey", "defaultActiveTabKey", "onTabChange", "children", "footer", "classNames", "styles"];
2
+ var _excluded = ["open", "onClose", "title", "name", "tags", "titleActions", "fields", "width", "maskClosable", "headerContent", "headerDivider", "description", "tabs", "activeTabKey", "defaultActiveTabKey", "onTabChange", "children", "footer", "classNames", "styles"];
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -8,23 +8,31 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
8
8
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
9
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
10
  import { forwardRef } from "react";
11
- import { ConfigProvider, theme } from "antd";
11
+ import { ConfigProvider } from "antd";
12
12
  import { CompanyDrawer, CompanyTabs } from "../../basic-components";
13
13
  import { companyTheme } from "../../theme";
14
14
  import "./index.scss";
15
15
 
16
16
  /** 详情抽屉内容区的 Tab 项 */
17
+
18
+ /** 顶部核心区的关键字段行(label + value 纯文字行,对齐设计稿) */
17
19
  import { jsx as _jsx } from "react/jsx-runtime";
18
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
19
21
  var DrawerDetailTemplateInner = function DrawerDetailTemplateInner(_ref, ref) {
20
22
  var open = _ref.open,
21
23
  onClose = _ref.onClose,
22
24
  title = _ref.title,
25
+ name = _ref.name,
26
+ tags = _ref.tags,
27
+ titleActions = _ref.titleActions,
28
+ fields = _ref.fields,
23
29
  _ref$width = _ref.width,
24
- width = _ref$width === void 0 ? 640 : _ref$width,
30
+ width = _ref$width === void 0 ? 440 : _ref$width,
25
31
  _ref$maskClosable = _ref.maskClosable,
26
32
  maskClosable = _ref$maskClosable === void 0 ? true : _ref$maskClosable,
27
33
  headerContent = _ref.headerContent,
34
+ _ref$headerDivider = _ref.headerDivider,
35
+ headerDivider = _ref$headerDivider === void 0 ? true : _ref$headerDivider,
28
36
  description = _ref.description,
29
37
  tabs = _ref.tabs,
30
38
  activeTabKey = _ref.activeTabKey,
@@ -35,12 +43,11 @@ var DrawerDetailTemplateInner = function DrawerDetailTemplateInner(_ref, ref) {
35
43
  classNames = _ref.classNames,
36
44
  styles = _ref.styles,
37
45
  rest = _objectWithoutProperties(_ref, _excluded);
38
- var _theme$useToken = theme.useToken(),
39
- token = _theme$useToken.token;
40
46
  var isPresent = function isPresent(value) {
41
47
  return value !== undefined && value !== null;
42
48
  };
43
- var hasHeader = isPresent(headerContent) || isPresent(description);
49
+ var hasStructuredHeader = isPresent(name) || isPresent(tags) || isPresent(titleActions) || fields && fields.length > 0;
50
+ var hasHeader = hasStructuredHeader || isPresent(headerContent) || isPresent(description);
44
51
 
45
52
  // classNames 支持对象/函数两种形式:统一走函数形式,确保 body 固定类不被覆盖
46
53
  var mergedClassNames = function mergedClassNames(info) {
@@ -52,20 +59,43 @@ var DrawerDetailTemplateInner = function DrawerDetailTemplateInner(_ref, ref) {
52
59
  var bodyNode = /*#__PURE__*/_jsxs("div", {
53
60
  className: "drawer-detail-template",
54
61
  ref: ref,
55
- children: [hasHeader ? /*#__PURE__*/_jsxs("div", {
56
- className: "drawer-detail-template__header",
57
- style: {
58
- padding: "".concat(token.paddingMD, "px ").concat(token.paddingLG, "px")
59
- },
60
- children: [headerContent, isPresent(description) ? /*#__PURE__*/_jsx("div", {
61
- className: "drawer-detail-template__description",
62
- style: {
63
- marginTop: token.marginXS
64
- },
65
- children: description
66
- }) : null]
62
+ children: [hasHeader ? /*#__PURE__*/_jsx("div", {
63
+ className: "drawer-detail-template__header".concat(headerDivider ? "" : " drawer-detail-template__header--no-divider"),
64
+ children: headerContent !== null && headerContent !== void 0 ? headerContent : /*#__PURE__*/_jsxs("div", {
65
+ className: "drawer-detail-template__header-inner",
66
+ children: [/*#__PURE__*/_jsxs("div", {
67
+ className: "drawer-detail-template__name-row",
68
+ children: [isPresent(name) ? /*#__PURE__*/_jsx("span", {
69
+ className: "drawer-detail-template__name",
70
+ children: name
71
+ }) : null, tags, /*#__PURE__*/_jsx("span", {
72
+ className: "drawer-detail-template__name-spacer"
73
+ }), isPresent(titleActions) ? /*#__PURE__*/_jsx("div", {
74
+ className: "drawer-detail-template__title-actions",
75
+ children: titleActions
76
+ }) : null]
77
+ }), fields && fields.length > 0 ? /*#__PURE__*/_jsx("div", {
78
+ className: "drawer-detail-template__fields",
79
+ children: fields.map(function (field, index) {
80
+ var _field$value;
81
+ return /*#__PURE__*/_jsxs("div", {
82
+ className: "drawer-detail-template__field",
83
+ children: [/*#__PURE__*/_jsxs("span", {
84
+ className: "drawer-detail-template__field-label",
85
+ children: [field.label, "\uFF1A"]
86
+ }), /*#__PURE__*/_jsx("span", {
87
+ className: "drawer-detail-template__field-value",
88
+ children: (_field$value = field.value) !== null && _field$value !== void 0 ? _field$value : "--"
89
+ })]
90
+ }, index);
91
+ })
92
+ }) : null, isPresent(description) ? /*#__PURE__*/_jsx("div", {
93
+ className: "drawer-detail-template__description",
94
+ children: description
95
+ }) : null]
96
+ })
67
97
  }) : null, /*#__PURE__*/_jsx("div", {
68
- className: "drawer-detail-template__content",
98
+ className: "drawer-detail-template__content".concat(tabs && tabs.length > 0 ? " drawer-detail-template__content--tabs" : ""),
69
99
  children: tabs && tabs.length > 0 ? /*#__PURE__*/_jsx(CompanyTabs, {
70
100
  className: "drawer-detail-template__tabs",
71
101
  activeKey: activeTabKey,
@@ -75,20 +105,10 @@ var DrawerDetailTemplateInner = function DrawerDetailTemplateInner(_ref, ref) {
75
105
  return {
76
106
  key: tab.key,
77
107
  label: tab.label,
78
- children: /*#__PURE__*/_jsx("div", {
79
- style: {
80
- padding: token.paddingLG
81
- },
82
- children: tab.content
83
- })
108
+ children: tab.content
84
109
  };
85
110
  })
86
- }) : /*#__PURE__*/_jsx("div", {
87
- style: {
88
- padding: token.paddingLG
89
- },
90
- children: children
91
- })
111
+ }) : children
92
112
  })]
93
113
  });
94
114
  return /*#__PURE__*/_jsx(ConfigProvider, {
@@ -96,7 +116,7 @@ var DrawerDetailTemplateInner = function DrawerDetailTemplateInner(_ref, ref) {
96
116
  children: /*#__PURE__*/_jsx(CompanyDrawer, _objectSpread(_objectSpread({
97
117
  open: open,
98
118
  title: title,
99
- width: width,
119
+ size: width,
100
120
  onClose: onClose,
101
121
  maskClosable: maskClosable,
102
122
  footer: footer !== null && footer !== void 0 ? footer : null,
@@ -1,6 +1,6 @@
1
1
  // 抽屉 body 改为 flex 容器且禁止整体滚动——顶部核心区固定、下方内容区滚动
2
- .drawer-detail-template__drawer-body {
3
- padding: 0;
2
+ // 特异性 (0,3,0) 覆盖 antd (.ant-drawer .ant-drawer-body) (0,2,0);padding 恢复 antd 默认 24px
3
+ .ant-drawer .ant-drawer-body.drawer-detail-template__drawer-body {
4
4
  display: flex;
5
5
  flex-direction: column;
6
6
  overflow: hidden;
@@ -19,15 +19,86 @@
19
19
  background: var(--color-bg-container);
20
20
  }
21
21
 
22
+ // Tab 模式下 TabBar 自带底部分割线,去掉 header 的避免双线
23
+ &__header--no-divider {
24
+ border-bottom: 0;
25
+ }
26
+
27
+ // 内置结构化头部:底部留 24px(分割线上方间距)
28
+ &__header-inner {
29
+ padding-bottom: 24px;
30
+ }
31
+
32
+ // 大标题行:24px/600 大标题 + 状态 Tag + 弹性占位 + 操作按钮
33
+ &__name-row {
34
+ display: flex;
35
+ align-items: center;
36
+ gap: 8px;
37
+ margin-bottom: 12px;
38
+ }
39
+
40
+ &__name {
41
+ font-size: 24px;
42
+ font-weight: 600;
43
+ line-height: 32px;
44
+ color: rgba(0, 0, 0, 0.88);
45
+ }
46
+
47
+ &__name-spacer {
48
+ flex: 1;
49
+ }
50
+
51
+ &__title-actions {
52
+ display: flex;
53
+ align-items: center;
54
+ gap: 8px;
55
+ }
56
+
57
+ // 关键字段行:label 45% 灰 + value 88% 黑,行间 gap 4px(对齐设计稿)
58
+ &__fields {
59
+ display: flex;
60
+ flex-direction: column;
61
+ gap: 4px;
62
+ }
63
+
64
+ &__field {
65
+ display: flex;
66
+ align-items: baseline;
67
+ line-height: 22px;
68
+ font-size: 14px;
69
+ }
70
+
71
+ &__field-label {
72
+ color: rgba(0, 0, 0, 0.45);
73
+ white-space: nowrap;
74
+ }
75
+
76
+ &__field-value {
77
+ color: rgba(0, 0, 0, 0.88);
78
+ word-break: break-all;
79
+ }
80
+
22
81
  &__description {
82
+ margin-top: 12px;
23
83
  color: var(--color-text-tertiary);
24
84
  }
25
85
 
26
- // 内容区:唯一滚动区域
86
+ // 内容区:唯一滚动区域(顶部留 24px,对齐 header 分割线下方间距)
27
87
  &__content {
28
88
  flex: 1;
29
89
  min-height: 0;
30
90
  overflow: auto;
91
+ padding-top: 24px;
92
+ }
93
+
94
+ // Tab 模式:TabBar 紧贴 header,无上间距
95
+ &__content--tabs {
96
+ padding-top: 0;
97
+ }
98
+
99
+ // 内容区垂直 Space(size="small")行间距由 antd 默认 8px 提到 16px,贴合详情排版
100
+ .ant-space-gap-row-small {
101
+ row-gap: 16px;
31
102
  }
32
103
 
33
104
  // Tab 模式:tabBar 固定在内容区顶部,仅 pane 内容滚动
@@ -38,8 +109,12 @@
38
109
 
39
110
  .ant-tabs-nav {
40
111
  flex-shrink: 0;
41
- margin-bottom: 0;
42
- border-bottom: 1px solid var(--color-border-secondary);
112
+ margin-bottom: 16px;
113
+ }
114
+
115
+ // antd 分割线 ::before 紧贴 tab 文字底部,线下方 16px 才是页签内容(margin 放 nav 上,避免撑高导致线错位)
116
+ .ant-tabs-nav-wrap {
117
+ padding-bottom: 0;
43
118
  }
44
119
 
45
120
  .ant-tabs-content-holder {
@@ -7,7 +7,7 @@ export { default as FormPageTemplate } from "./FormPageTemplate";
7
7
  export { default as DrawerFormTemplate } from "./DrawerFormTemplate";
8
8
  export type { DrawerFormTemplateProps } from "./DrawerFormTemplate";
9
9
  export { default as DrawerDetailTemplate } from "./DrawerDetailTemplate";
10
- export type { DrawerDetailTemplateProps, DrawerDetailTab } from "./DrawerDetailTemplate";
10
+ export type { DrawerDetailTemplateProps, DrawerDetailTab, DrawerDetailField, } from "./DrawerDetailTemplate";
11
11
  export { default as DetailPageTemplate } from "./DetailPageTemplate";
12
12
  export type { DetailFieldItem, DetailTagItem, DetailTabItem } from "./DetailPageTemplate";
13
13
  export { default as IconSelect } from "./IconSelect";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donglegeyu/company-ui",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/es/index.d.ts",