cnhis-design-vue 3.1.13-beta.3 → 3.1.13-beta.4

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.
@@ -249,6 +249,11 @@ body > .vxe-table--tooltip-wrapper {
249
249
  height: 100%;
250
250
  line-height: unset;
251
251
  width: 100%;
252
+ display: inline-flex;
253
+ }
254
+ .custom-big-table .vxe-table .vxe-table--header .col--seq .vxe-cell--title,
255
+ .custom-big-table .vxe-table .vxe-table--header .col--checkbox .vxe-cell--title {
256
+ display: inline-block;
252
257
  }
253
258
  .custom-big-table .vxe-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar,
254
259
  .custom-big-table .vxe-table .vxe-table--body-wrapper::-webkit-scrollbar {
@@ -1,6 +1,6 @@
1
1
  import { reactive, onMounted, nextTick } from 'vue';
2
2
  import { fabric } from '../utils/index.js';
3
- import { defaultStyle, drawLine, drawPoint, defaultTextStyle } from './useDraw.js';
3
+ import { defaultStyle, drawPoint, drawLine, defaultTextStyle } from './useDraw.js';
4
4
  import useGrid from './useGrid.js';
5
5
  import { useShadow } from './useShadow.js';
6
6
  import { TEMPERATURE_MENU, PAIN_MENU } from './constant.js';
@@ -36,6 +36,8 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
36
36
  target: null
37
37
  });
38
38
  const shadowLinesCache = /* @__PURE__ */ new Set();
39
+ const maiboPoints = /* @__PURE__ */ new Set();
40
+ const otherPoints = /* @__PURE__ */ new Set();
39
41
  onMounted(() => {
40
42
  nextTick(() => {
41
43
  init();
@@ -48,6 +50,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
48
50
  drawPolyLine(item, dataIndex, scaleValue);
49
51
  });
50
52
  });
53
+ drawOverlapPoint();
51
54
  setCanvasEvent();
52
55
  }
53
56
  function drawShaDow(target) {
@@ -181,13 +184,49 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
181
184
  }
182
185
  function getEqualXTypes(pointX) {
183
186
  const types = [];
187
+ const left2 = cumputedX(getXValue(pointX));
184
188
  canvas.value.forEachObject((obj) => {
185
- if (obj.origin && cumputedX(getXValue(pointX)) === obj.left) {
189
+ if (obj.origin && left2 === obj.left) {
186
190
  types.push(obj.origin.type);
187
191
  }
188
192
  });
189
193
  return [...new Set(types)];
190
194
  }
195
+ function drawOverlapPoint() {
196
+ var _a;
197
+ const pulseObj = left.yScaleValue.find((item) => item.type === "pulse");
198
+ if (!pulseObj || !((_a = pulseObj.dataList) == null ? void 0 : _a.length))
199
+ return;
200
+ if (!pulseObj.dataList.some((item) => item.title.includes("\u8109\u640F")))
201
+ return;
202
+ const overlap = left.overlap || {};
203
+ maiboPoints.size && [...maiboPoints].forEach((item) => {
204
+ [...otherPoints].forEach((obj) => {
205
+ if (obj.origin && item.left === obj.left && item.top === obj.top) {
206
+ const key = obj.origin.key;
207
+ if (key) {
208
+ console.log(333, key);
209
+ const pointer = {
210
+ left: obj.left,
211
+ top: obj.top,
212
+ defaultStyle
213
+ };
214
+ let type = "koumai";
215
+ if (key === "yemai") {
216
+ type = key;
217
+ }
218
+ if (key === "humai") {
219
+ type = "circle";
220
+ }
221
+ drawPoint(type, {
222
+ ...overlap[key] || {},
223
+ ...pointer
224
+ });
225
+ }
226
+ }
227
+ });
228
+ });
229
+ }
191
230
  function drawPolyLine(item, dataIndex, scaleValue) {
192
231
  const {
193
232
  pointAttr = {},
@@ -290,6 +329,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
290
329
  origin: {
291
330
  data: v,
292
331
  title: item.title,
332
+ key: item.key || "",
293
333
  unit: scaleValue.unit,
294
334
  type: scaleValue.type,
295
335
  dataIndex,
@@ -323,6 +363,11 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
323
363
  }
324
364
  lineList.push(line);
325
365
  if (point) {
366
+ if (item.title.includes("\u8109\u640F")) {
367
+ maiboPoints.add(point);
368
+ } else {
369
+ otherPoints.add(point);
370
+ }
326
371
  setPointEvent(point);
327
372
  pointList.push(point);
328
373
  }
@@ -39,4 +39,4 @@ export declare const defaultTextStyle: {
39
39
  };
40
40
  export declare function drawLine(points: number[], style: Partial<ILineOptions>): fabric.Line;
41
41
  export declare function drawTextGroup(rectStyle: Partial<fabric.IRectOptions>, fontStyle: Partial<ITextOptions>, groupStyle: Partial<fabric.IGroupOptions>): fabric.Group;
42
- export declare function drawPoint(type: string | undefined, style: any): fabric.Circle | fabric.Triangle;
42
+ export declare function drawPoint(type: string | undefined, style: any): fabric.Object;
@@ -57,7 +57,6 @@ function drawTextGroup(rectStyle, fontStyle, groupStyle) {
57
57
  });
58
58
  }
59
59
  function drawPoint(type = "circle", style) {
60
- let point = null;
61
60
  const newStyle = {
62
61
  originX: "center",
63
62
  originY: "center",
@@ -65,27 +64,87 @@ function drawPoint(type = "circle", style) {
65
64
  hasBorders: false,
66
65
  ...style
67
66
  };
67
+ const createCircleBorder = (data) => {
68
+ return new fabric.Circle({
69
+ objectCaching: false,
70
+ strokeWidth: 1,
71
+ radius: 5,
72
+ scale: 1,
73
+ fill: "#fff",
74
+ ...data
75
+ });
76
+ };
68
77
  switch (type) {
69
78
  case "triangle":
70
- point = new fabric.Triangle({
79
+ return new fabric.Triangle({
71
80
  width: 20,
72
81
  height: 20,
73
82
  strokeWidth: 1,
74
83
  scale: 1,
75
84
  ...newStyle
76
85
  });
77
- break;
78
86
  case "circle":
79
- point = new fabric.Circle({
87
+ return new fabric.Circle({
80
88
  objectCaching: false,
81
89
  strokeWidth: 1,
82
90
  radius: 5,
83
91
  scale: 1,
84
92
  ...newStyle
85
93
  });
86
- break;
94
+ case "image":
95
+ if (style == null ? void 0 : style.url) ; else {
96
+ return new fabric.Image(style.element, {
97
+ ...newStyle,
98
+ scale: 1
99
+ });
100
+ }
101
+ case "yemai":
102
+ const createAdd = (data) => {
103
+ const width = (data.radius || 5) * 2;
104
+ const line1 = new fabric.Line([0, width / 2, width, width / 2], {
105
+ ...data,
106
+ stroke: data.strokeX,
107
+ strokeWidth: data.strokeWidth,
108
+ angle: 0
109
+ });
110
+ const line2 = new fabric.Line([width / 2, 0, width / 2, width], {
111
+ ...data,
112
+ angle: 0
113
+ });
114
+ return new fabric.Group([line1, line2], {
115
+ scale: 1,
116
+ ...data
117
+ });
118
+ };
119
+ return new fabric.Group([createCircleBorder(style), createAdd(style)], {
120
+ scale: 1,
121
+ ...style,
122
+ angle: 0
123
+ });
124
+ case "koumai":
125
+ const circle = new fabric.Circle({
126
+ objectCaching: false,
127
+ radius: style.radiusCircle || 2,
128
+ fill: style.fillCircle || "#000",
129
+ originX: "center",
130
+ originY: "center",
131
+ left: style.left,
132
+ top: style.top
133
+ });
134
+ return new fabric.Group([createCircleBorder(style), circle], {
135
+ scale: 1,
136
+ ...style
137
+ });
138
+ default:
139
+ style && Reflect.deleteProperty(style, "stroke");
140
+ return new fabric.Text(String(type), {
141
+ fontFamily: "\u5FAE\u8F6F\u96C5\u9ED1",
142
+ scale: 1,
143
+ fontSize: 14,
144
+ fill: "#000",
145
+ ...newStyle
146
+ });
87
147
  }
88
- return point;
89
148
  }
90
149
 
91
150
  export { defaultBorderStyle, defaultLineStyle, defaultRectStyle, defaultStyle, defaultTextStyle, drawLine, drawPoint, drawTextGroup };
@@ -80,6 +80,7 @@ export interface ITop {
80
80
  operationDays?: IDate;
81
81
  }
82
82
  interface ILeft {
83
+ overlap?: any;
83
84
  spaceGridNumber?: number;
84
85
  yScaleValue: Array<any>;
85
86
  icons?: any;
@@ -99,6 +99,9 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
99
99
  type: import("vue").PropType<import("../../../es/src/types").AnyObject>;
100
100
  default: () => {};
101
101
  };
102
+ annotation: {
103
+ type: import("vue").PropType<import("../../../es/src/types").AnyObject>;
104
+ };
102
105
  consumer: {
103
106
  type: BooleanConstructor;
104
107
  default: boolean;
@@ -204,6 +207,9 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
204
207
  type: import("vue").PropType<import("../../../es/src/types").AnyObject>;
205
208
  default: () => {};
206
209
  };
210
+ annotation: {
211
+ type: import("vue").PropType<import("../../../es/src/types").AnyObject>;
212
+ };
207
213
  consumer: {
208
214
  type: BooleanConstructor;
209
215
  default: boolean;
@@ -1396,6 +1402,9 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
1396
1402
  type: import("vue").PropType<import("../../../es/src/types").AnyObject>;
1397
1403
  default: () => {};
1398
1404
  };
1405
+ annotation: {
1406
+ type: import("vue").PropType<import("../../../es/src/types").AnyObject>;
1407
+ };
1399
1408
  consumer: {
1400
1409
  type: BooleanConstructor;
1401
1410
  default: boolean;
@@ -99,6 +99,9 @@ declare const _default: import("vue").DefineComponent<{
99
99
  type: PropType<AnyObject>;
100
100
  default: () => {};
101
101
  };
102
+ annotation: {
103
+ type: PropType<AnyObject>;
104
+ };
102
105
  consumer: {
103
106
  type: BooleanConstructor;
104
107
  default: boolean;
@@ -204,6 +207,9 @@ declare const _default: import("vue").DefineComponent<{
204
207
  type: PropType<AnyObject>;
205
208
  default: () => {};
206
209
  };
210
+ annotation: {
211
+ type: PropType<AnyObject>;
212
+ };
207
213
  consumer: {
208
214
  type: BooleanConstructor;
209
215
  default: boolean;
@@ -1396,6 +1402,9 @@ declare const _default: import("vue").DefineComponent<{
1396
1402
  type: PropType<AnyObject>;
1397
1403
  default: () => {};
1398
1404
  };
1405
+ annotation: {
1406
+ type: PropType<AnyObject>;
1407
+ };
1399
1408
  consumer: {
1400
1409
  type: BooleanConstructor;
1401
1410
  default: boolean;
@@ -31,6 +31,7 @@ var script = /* @__PURE__ */ defineComponent({
31
31
  },
32
32
  businessFilter: { type: Function },
33
33
  scope: { type: Object, default: () => ({}) },
34
+ annotation: { type: Object },
34
35
  consumer: { type: Boolean, default: false },
35
36
  uuid: { type: String }
36
37
  },
@@ -104,7 +105,7 @@ var script = /* @__PURE__ */ defineComponent({
104
105
  }
105
106
  });
106
107
  return (_ctx, _cache) => {
107
- return openBlock(), createBlock(unref(NForm), null, {
108
+ return openBlock(), createBlock(unref(NForm), { class: "form-render" }, {
108
109
  default: withCtx(() => [
109
110
  __props.anchor ? (openBlock(), createElementBlock("section", _hoisted_1, [
110
111
  createVNode(unref(NTabs), {
@@ -1,294 +1,9 @@
1
1
  export declare const FORM_ITEM: import("vue").DefineComponent<{
2
- readonly label: StringConstructor;
3
- readonly labelWidth: import("vue").PropType<string | number>;
4
- readonly labelStyle: import("vue").PropType<string | import("vue").CSSProperties>;
5
- readonly labelAlign: import("vue").PropType<import("naive-ui/es/form/src/interface").LabelAlign>;
6
- readonly labelPlacement: import("vue").PropType<import("naive-ui/es/form/src/interface").LabelPlacement>;
7
- readonly path: StringConstructor;
8
- readonly first: BooleanConstructor;
9
- readonly rulePath: StringConstructor;
10
- readonly required: BooleanConstructor;
11
- readonly showRequireMark: {
12
- readonly type: import("vue").PropType<boolean | undefined>;
13
- readonly default: undefined;
14
- };
15
- readonly requireMarkPlacement: import("vue").PropType<"left" | "right" | "right-hanging">;
16
- readonly showFeedback: {
17
- readonly type: import("vue").PropType<boolean | undefined>;
18
- readonly default: undefined;
19
- };
20
- readonly rule: import("vue").PropType<import("naive-ui").FormItemRule | import("naive-ui").FormItemRule[]>;
21
- readonly size: import("vue").PropType<"small" | "medium" | "large">;
22
- readonly ignorePathChange: BooleanConstructor;
23
- readonly validationStatus: import("vue").PropType<"success" | "warning" | "error">;
24
- readonly feedback: StringConstructor;
25
- readonly showLabel: {
26
- readonly type: import("vue").PropType<boolean | undefined>;
27
- readonly default: undefined;
28
- };
29
- readonly labelProps: import("vue").PropType<import("vue").LabelHTMLAttributes>;
30
- readonly theme: import("vue").PropType<import("naive-ui/es/_mixins").Theme<"Form", {
31
- blankHeightSmall: string;
32
- blankHeightMedium: string;
33
- blankHeightLarge: string;
34
- lineHeight: string;
35
- labelTextColor: string;
36
- asteriskColor: string;
37
- feedbackTextColorError: string;
38
- feedbackTextColorWarning: string;
39
- feedbackTextColor: string;
40
- feedbackPadding: string;
41
- feedbackHeightSmall: string;
42
- feedbackHeightMedium: string;
43
- feedbackHeightLarge: string;
44
- feedbackFontSizeSmall: string;
45
- feedbackFontSizeMedium: string;
46
- feedbackFontSizeLarge: string;
47
- labelFontSizeLeftSmall: string;
48
- labelFontSizeLeftMedium: string;
49
- labelFontSizeLeftLarge: string;
50
- labelFontSizeTopSmall: string;
51
- labelFontSizeTopMedium: string;
52
- labelFontSizeTopLarge: string;
53
- labelHeightSmall: string;
54
- labelHeightMedium: string;
55
- labelHeightLarge: string;
56
- labelPaddingVertical: string;
57
- labelPaddingHorizontal: string;
58
- labelTextAlignVertical: string;
59
- labelTextAlignHorizontal: string;
60
- }, any>>;
61
- readonly themeOverrides: import("vue").PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Form", {
62
- blankHeightSmall: string;
63
- blankHeightMedium: string;
64
- blankHeightLarge: string;
65
- lineHeight: string;
66
- labelTextColor: string;
67
- asteriskColor: string;
68
- feedbackTextColorError: string;
69
- feedbackTextColorWarning: string;
70
- feedbackTextColor: string;
71
- feedbackPadding: string;
72
- feedbackHeightSmall: string;
73
- feedbackHeightMedium: string;
74
- feedbackHeightLarge: string;
75
- feedbackFontSizeSmall: string;
76
- feedbackFontSizeMedium: string;
77
- feedbackFontSizeLarge: string;
78
- labelFontSizeLeftSmall: string;
79
- labelFontSizeLeftMedium: string;
80
- labelFontSizeLeftLarge: string;
81
- labelFontSizeTopSmall: string;
82
- labelFontSizeTopMedium: string;
83
- labelFontSizeTopLarge: string;
84
- labelHeightSmall: string;
85
- labelHeightMedium: string;
86
- labelHeightLarge: string;
87
- labelPaddingVertical: string;
88
- labelPaddingHorizontal: string;
89
- labelTextAlignVertical: string;
90
- labelTextAlignHorizontal: string;
91
- }, any>>>;
92
- readonly builtinThemeOverrides: import("vue").PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Form", {
93
- blankHeightSmall: string;
94
- blankHeightMedium: string;
95
- blankHeightLarge: string;
96
- lineHeight: string;
97
- labelTextColor: string;
98
- asteriskColor: string;
99
- feedbackTextColorError: string;
100
- feedbackTextColorWarning: string;
101
- feedbackTextColor: string;
102
- feedbackPadding: string;
103
- feedbackHeightSmall: string;
104
- feedbackHeightMedium: string;
105
- feedbackHeightLarge: string;
106
- feedbackFontSizeSmall: string;
107
- feedbackFontSizeMedium: string;
108
- feedbackFontSizeLarge: string;
109
- labelFontSizeLeftSmall: string;
110
- labelFontSizeLeftMedium: string;
111
- labelFontSizeLeftLarge: string;
112
- labelFontSizeTopSmall: string;
113
- labelFontSizeTopMedium: string;
114
- labelFontSizeTopLarge: string;
115
- labelHeightSmall: string;
116
- labelHeightMedium: string;
117
- labelHeightLarge: string;
118
- labelPaddingVertical: string;
119
- labelPaddingHorizontal: string;
120
- labelTextAlignVertical: string;
121
- labelTextAlignHorizontal: string;
122
- }, any>>>;
123
- }, {
124
- cssVars: import("vue").ComputedRef<{
125
- '--n-bezier': string;
126
- '--n-line-height': string;
127
- '--n-blank-height': string;
128
- '--n-label-font-size': string;
129
- '--n-label-text-align': string;
130
- '--n-label-height': string;
131
- '--n-label-padding': string;
132
- '--n-asterisk-color': string;
133
- '--n-label-text-color': string;
134
- '--n-feedback-padding': string;
135
- '--n-feedback-font-size': string;
136
- '--n-feedback-height': string;
137
- '--n-feedback-text-color': string;
138
- '--n-feedback-text-color-warning': string;
139
- '--n-feedback-text-color-error': string;
140
- }> | undefined;
141
- themeClass: import("vue").Ref<string>;
142
- onRender: () => void;
143
- validate: import("naive-ui/es/form/src/interface").FormItemValidate;
144
- restoreValidation: () => void;
145
- path?: string | undefined;
146
- internalValidate: import("naive-ui/es/form/src/interface").FormItemInternalValidate;
147
- mergedSize: import("vue").ComputedRef<import("naive-ui/es/form/src/interface").Size>;
148
- validationErrored: import("vue").Ref<boolean>;
149
- mergedLabelStyle: import("vue").ComputedRef<(import("vue").StyleValue | undefined)[]>;
150
- mergedLabelPlacement: import("vue").ComputedRef<import("naive-ui/es/form/src/interface").LabelPlacement>;
151
- mergedLabelAlign: import("vue").ComputedRef<import("naive-ui/es/form/src/interface").LabelAlign | undefined>;
152
- mergedShowRequireMark: import("vue").ComputedRef<boolean | undefined>;
153
- mergedRequireMarkPlacement: import("vue").ComputedRef<"left" | "right" | "right-hanging">;
154
- mergedValidationStatus: import("vue").ComputedRef<"success" | "warning" | "error" | undefined>;
155
- mergedShowFeedback: import("vue").ComputedRef<boolean>;
156
- mergedShowLabel: import("vue").ComputedRef<boolean>;
157
- labelElementRef: import("vue").Ref<HTMLLabelElement | null>;
158
- mergedClsPrefix: import("vue").ComputedRef<string>;
159
- mergedRequired: import("vue").ComputedRef<boolean>;
160
- feedbackId: import("vue").Ref<string>;
161
- renderExplains: import("vue").Ref<{
162
- key: string;
163
- render: () => import("vue").VNodeChild;
164
- }[]>;
165
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
166
- readonly label: StringConstructor;
167
- readonly labelWidth: import("vue").PropType<string | number>;
168
- readonly labelStyle: import("vue").PropType<string | import("vue").CSSProperties>;
169
- readonly labelAlign: import("vue").PropType<import("naive-ui/es/form/src/interface").LabelAlign>;
170
- readonly labelPlacement: import("vue").PropType<import("naive-ui/es/form/src/interface").LabelPlacement>;
171
- readonly path: StringConstructor;
172
- readonly first: BooleanConstructor;
173
- readonly rulePath: StringConstructor;
174
- readonly required: BooleanConstructor;
175
- readonly showRequireMark: {
176
- readonly type: import("vue").PropType<boolean | undefined>;
177
- readonly default: undefined;
178
- };
179
- readonly requireMarkPlacement: import("vue").PropType<"left" | "right" | "right-hanging">;
180
- readonly showFeedback: {
181
- readonly type: import("vue").PropType<boolean | undefined>;
182
- readonly default: undefined;
183
- };
184
- readonly rule: import("vue").PropType<import("naive-ui").FormItemRule | import("naive-ui").FormItemRule[]>;
185
- readonly size: import("vue").PropType<"small" | "medium" | "large">;
186
- readonly ignorePathChange: BooleanConstructor;
187
- readonly validationStatus: import("vue").PropType<"success" | "warning" | "error">;
188
- readonly feedback: StringConstructor;
189
- readonly showLabel: {
190
- readonly type: import("vue").PropType<boolean | undefined>;
191
- readonly default: undefined;
192
- };
193
- readonly labelProps: import("vue").PropType<import("vue").LabelHTMLAttributes>;
194
- readonly theme: import("vue").PropType<import("naive-ui/es/_mixins").Theme<"Form", {
195
- blankHeightSmall: string;
196
- blankHeightMedium: string;
197
- blankHeightLarge: string;
198
- lineHeight: string;
199
- labelTextColor: string;
200
- asteriskColor: string;
201
- feedbackTextColorError: string;
202
- feedbackTextColorWarning: string;
203
- feedbackTextColor: string;
204
- feedbackPadding: string;
205
- feedbackHeightSmall: string;
206
- feedbackHeightMedium: string;
207
- feedbackHeightLarge: string;
208
- feedbackFontSizeSmall: string;
209
- feedbackFontSizeMedium: string;
210
- feedbackFontSizeLarge: string;
211
- labelFontSizeLeftSmall: string;
212
- labelFontSizeLeftMedium: string;
213
- labelFontSizeLeftLarge: string;
214
- labelFontSizeTopSmall: string;
215
- labelFontSizeTopMedium: string;
216
- labelFontSizeTopLarge: string;
217
- labelHeightSmall: string;
218
- labelHeightMedium: string;
219
- labelHeightLarge: string;
220
- labelPaddingVertical: string;
221
- labelPaddingHorizontal: string;
222
- labelTextAlignVertical: string;
223
- labelTextAlignHorizontal: string;
224
- }, any>>;
225
- readonly themeOverrides: import("vue").PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Form", {
226
- blankHeightSmall: string;
227
- blankHeightMedium: string;
228
- blankHeightLarge: string;
229
- lineHeight: string;
230
- labelTextColor: string;
231
- asteriskColor: string;
232
- feedbackTextColorError: string;
233
- feedbackTextColorWarning: string;
234
- feedbackTextColor: string;
235
- feedbackPadding: string;
236
- feedbackHeightSmall: string;
237
- feedbackHeightMedium: string;
238
- feedbackHeightLarge: string;
239
- feedbackFontSizeSmall: string;
240
- feedbackFontSizeMedium: string;
241
- feedbackFontSizeLarge: string;
242
- labelFontSizeLeftSmall: string;
243
- labelFontSizeLeftMedium: string;
244
- labelFontSizeLeftLarge: string;
245
- labelFontSizeTopSmall: string;
246
- labelFontSizeTopMedium: string;
247
- labelFontSizeTopLarge: string;
248
- labelHeightSmall: string;
249
- labelHeightMedium: string;
250
- labelHeightLarge: string;
251
- labelPaddingVertical: string;
252
- labelPaddingHorizontal: string;
253
- labelTextAlignVertical: string;
254
- labelTextAlignHorizontal: string;
255
- }, any>>>;
256
- readonly builtinThemeOverrides: import("vue").PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Form", {
257
- blankHeightSmall: string;
258
- blankHeightMedium: string;
259
- blankHeightLarge: string;
260
- lineHeight: string;
261
- labelTextColor: string;
262
- asteriskColor: string;
263
- feedbackTextColorError: string;
264
- feedbackTextColorWarning: string;
265
- feedbackTextColor: string;
266
- feedbackPadding: string;
267
- feedbackHeightSmall: string;
268
- feedbackHeightMedium: string;
269
- feedbackHeightLarge: string;
270
- feedbackFontSizeSmall: string;
271
- feedbackFontSizeMedium: string;
272
- feedbackFontSizeLarge: string;
273
- labelFontSizeLeftSmall: string;
274
- labelFontSizeLeftMedium: string;
275
- labelFontSizeLeftLarge: string;
276
- labelFontSizeTopSmall: string;
277
- labelFontSizeTopMedium: string;
278
- labelFontSizeTopLarge: string;
279
- labelHeightSmall: string;
280
- labelHeightMedium: string;
281
- labelHeightLarge: string;
282
- labelPaddingVertical: string;
283
- labelPaddingHorizontal: string;
284
- labelTextAlignVertical: string;
285
- labelTextAlignHorizontal: string;
286
- }, any>>>;
287
- }>>, {
288
- readonly required: boolean;
289
- readonly first: boolean;
290
- readonly showRequireMark: boolean | undefined;
291
- readonly showFeedback: boolean | undefined;
292
- readonly showLabel: boolean | undefined;
293
- readonly ignorePathChange: boolean;
294
- }>;
2
+ label: StringConstructor;
3
+ propertyKey: StringConstructor;
4
+ annotation: {};
5
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
6
+ label: StringConstructor;
7
+ propertyKey: StringConstructor;
8
+ annotation: {};
9
+ }>>, {}>;
@@ -1,8 +1,141 @@
1
+ import { defineComponent, inject, computed, ref, createVNode } from 'vue';
1
2
  import { isVoidField } from '@formily/core';
2
3
  import { connect, mapProps } from '@formily/vue';
3
- import { NFormItem } from 'naive-ui';
4
+ import { FileTrayFull, FileTray } from '@vicons/ionicons5';
5
+ import { isBoolean } from 'lodash-es';
6
+ import { NFormItem, NPopover, NIcon, NInput } from 'naive-ui';
7
+ import { InjectionAnnotation } from '../../../../../packages/form-render/src/constants';
4
8
 
5
- const FORM_ITEM = connect(NFormItem, mapProps({
9
+ const script = defineComponent({
10
+ props: {
11
+ label: String,
12
+ propertyKey: String,
13
+ annotation: {}
14
+ },
15
+ setup(props, {
16
+ slots,
17
+ attrs
18
+ }) {
19
+ const annotation = inject(InjectionAnnotation);
20
+ const annotationContent = computed({
21
+ get() {
22
+ return annotation.value[props.propertyKey];
23
+ },
24
+ set(value) {
25
+ annotation.value = {
26
+ property: props.propertyKey,
27
+ value
28
+ };
29
+ }
30
+ });
31
+ function renderTextarea() {
32
+ return createVNode(NInput, {
33
+ "type": "textarea",
34
+ "value": annotationContent.value,
35
+ "onUpdate:value": ($event) => annotationContent.value = $event
36
+ }, null);
37
+ }
38
+ const __showPopper = ref(false);
39
+ const showPopper = computed({
40
+ get() {
41
+ return __showPopper.value;
42
+ },
43
+ async set(value) {
44
+ __showPopper.value = value;
45
+ if (!value && isEdit.value) {
46
+ await new Promise((resolve) => setTimeout(resolve, 200));
47
+ isEdit.value = false;
48
+ }
49
+ }
50
+ });
51
+ const isEdit = ref(false);
52
+ let clickTimer;
53
+ function iconClick() {
54
+ clearTimeout(clickTimer);
55
+ if (showPopper.value && isEdit.value) {
56
+ showPopper.value = false;
57
+ return;
58
+ }
59
+ clickTimer = setTimeout(() => {
60
+ if (!annotationContent.value) {
61
+ isEdit.value = showPopper.value = true;
62
+ }
63
+ }, 200);
64
+ }
65
+ function iconDbClick() {
66
+ clearTimeout(clickTimer);
67
+ if (!annotationContent.value)
68
+ return;
69
+ showPopper.value = true;
70
+ isEdit.value = true;
71
+ }
72
+ function iconMouseenter() {
73
+ if (!annotationContent.value)
74
+ return;
75
+ showPopper.value = true;
76
+ }
77
+ function iconMouseleave() {
78
+ if (!annotationContent.value || isEdit.value)
79
+ return;
80
+ showPopper.value = false;
81
+ }
82
+ function renderAnnotation() {
83
+ return createVNode("section", {
84
+ "class": ["form-render__formItemLabel--annotation", {
85
+ "is-active": !!annotationContent.value
86
+ }],
87
+ "style": {
88
+ "--icon-right": attrs.required ? "-30" : "-20"
89
+ },
90
+ "form-item-hover-show": !annotationContent.value && !isEdit.value
91
+ }, [createVNode(NPopover, {
92
+ "style": {
93
+ maxWidth: "200px",
94
+ wordBreak: "break-all"
95
+ },
96
+ "show": showPopper.value,
97
+ "onUpdate:show": ($event) => showPopper.value = $event,
98
+ "trigger": "manual",
99
+ "duration": 100
100
+ }, {
101
+ default: renderDefault,
102
+ trigger: renderTrigger
103
+ })]);
104
+ function renderText() {
105
+ return createVNode("span", null, [annotationContent.value]);
106
+ }
107
+ function renderDefault() {
108
+ return createVNode("div", null, [isEdit.value ? renderTextarea() : renderText()]);
109
+ }
110
+ function renderTrigger() {
111
+ return createVNode("div", {
112
+ "onMouseleave": iconMouseleave,
113
+ "onMouseenter": iconMouseenter,
114
+ "onDblclick": iconDbClick,
115
+ "onClick": iconClick
116
+ }, [createVNode(NIcon, {
117
+ "component": annotationContent.value ? FileTrayFull : FileTray
118
+ }, null)]);
119
+ }
120
+ }
121
+ const showAnnotation = computed(() => {
122
+ return annotation.value && (!isBoolean(props.annotation) || props.annotation);
123
+ });
124
+ const showLabel = computed(() => props.label && props.label !== " ");
125
+ function renderLabel() {
126
+ return showLabel.value ? createVNode("section", {
127
+ "class": "form-render__formItemLabel"
128
+ }, [createVNode("span", {
129
+ "class": "form-render__formItemLabel--text"
130
+ }, [props.label]), showAnnotation.value ? renderAnnotation() : null]) : null;
131
+ }
132
+ return () => createVNode(NFormItem, null, {
133
+ ...slots,
134
+ label: renderLabel
135
+ });
136
+ }
137
+ });
138
+ const FORM_ITEM = connect(script, mapProps({
6
139
  title: "label"
7
140
  }, (props, field) => {
8
141
  var _a;
@@ -1,13 +1,14 @@
1
1
  import { ContextCollector } from '../../../../../es/packages/form-render/src/hooks/useChangeContext';
2
2
  import { BusinessCollector, FormItemDepsCollector } from '../hooks';
3
3
  import { FormAsyncQueue } from '../types';
4
- import { Component, InjectionKey } from 'vue';
4
+ import { Component, InjectionKey, WritableComputedRef } from 'vue';
5
5
  export declare const InjectAsyncQueue: InjectionKey<FormAsyncQueue>;
6
6
  export declare const InjectionSchemaField: InjectionKey<Component>;
7
7
  export declare const InjectionBusinessCollector: InjectionKey<BusinessCollector>;
8
8
  export declare const InjectionChangeContextCollector: InjectionKey<ContextCollector>;
9
9
  export declare const InjectionFormItemDepsCollector: InjectionKey<FormItemDepsCollector>;
10
10
  export declare const InjectionFormUUID: InjectionKey<string>;
11
+ export declare const InjectionAnnotation: InjectionKey<WritableComputedRef<Record<string, string>>>;
11
12
  export declare const FormItemLineBarDepKeyPrepend = "__dep_LINEBAR_";
12
13
  export declare enum FIELD_BUSINESS_TYPE {
13
14
  PASSWORD = "password",
@@ -4,6 +4,7 @@ const InjectionBusinessCollector = Symbol("InjectionBusinessCollector");
4
4
  const InjectionChangeContextCollector = Symbol("InjectionChangeContextCollector");
5
5
  const InjectionFormItemDepsCollector = Symbol("InjectionFormItemDepsCollector");
6
6
  const InjectionFormUUID = Symbol("InjectionFormUUID");
7
+ const InjectionAnnotation = Symbol("InjectionAnnotation");
7
8
  const FormItemLineBarDepKeyPrepend = "__dep_LINEBAR_";
8
9
  var FIELD_BUSINESS_TYPE = /* @__PURE__ */ ((FIELD_BUSINESS_TYPE2) => {
9
10
  FIELD_BUSINESS_TYPE2["PASSWORD"] = "password";
@@ -37,4 +38,4 @@ var FIELD_AGE_UNIT = /* @__PURE__ */ ((FIELD_AGE_UNIT2) => {
37
38
  return FIELD_AGE_UNIT2;
38
39
  })(FIELD_AGE_UNIT || {});
39
40
 
40
- export { FIELD_AGE_UNIT, FIELD_BUSINESS_TYPE, FIELD_SEX_VALUE, FormItemLineBarDepKeyPrepend, InjectAsyncQueue, InjectionBusinessCollector, InjectionChangeContextCollector, InjectionFormItemDepsCollector, InjectionFormUUID, InjectionSchemaField };
41
+ export { FIELD_AGE_UNIT, FIELD_BUSINESS_TYPE, FIELD_SEX_VALUE, FormItemLineBarDepKeyPrepend, InjectAsyncQueue, InjectionAnnotation, InjectionBusinessCollector, InjectionChangeContextCollector, InjectionFormItemDepsCollector, InjectionFormUUID, InjectionSchemaField };
@@ -13,7 +13,7 @@ function useFieldListAdaptor(collector, uuid) {
13
13
  "x-component": item.html_type,
14
14
  "x-component-props": {
15
15
  placeholder: item.placeholder,
16
- clearable: item.is_empty === "1",
16
+ clearable: item.is_empty === "0",
17
17
  ...item.componentProps || {}
18
18
  },
19
19
  "x-display": item.is_show === "0" ? "hidden" : "visible",
@@ -28,6 +28,8 @@ function useFieldListAdaptor(collector, uuid) {
28
28
  "x-decorator-props": {
29
29
  span: item.elem_width,
30
30
  showLabel: item.hide_title !== "1",
31
+ propertyKey: item.val_key,
32
+ annotation: item.annotation,
31
33
  id: `${uuid}-${item.val_key}`,
32
34
  ...item.decoratorProps || {}
33
35
  }
@@ -1,5 +1,6 @@
1
+ import { ShallowReactive } from 'vue';
1
2
  import { AnyObject } from '../../../../../es/src/types';
2
- export declare function useFormContext(props: AnyObject): {
3
+ export declare function useFormContext(props: ShallowReactive<AnyObject>): {
3
4
  asyncQueue: import("../../../../../es/packages/form-render").FormAsyncQueue;
4
5
  SchemaField: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
5
6
  businessCollector: import("../../../../../es/packages/form-render").BusinessCollector;
@@ -1,10 +1,11 @@
1
- import { provide } from 'vue';
1
+ import { isObject } from 'lodash-es';
2
+ import { provide, computed, readonly } from 'vue';
2
3
  import { createSchemaField } from '@formily/vue';
3
4
  import { useAsyncQueue, useBusinessBinding, useChangeContext, useFormItemDeps } from '../../../../packages/form-render';
4
5
  import * as components from '../../../../packages/form-render/src/components/renderer';
5
6
  import { usePresetScope } from '../../../../packages/form-render/src/hooks/usePresetScope';
6
7
  import { injectOrProvide, uuidGenerator } from '../../../../packages/form-render/src/utils';
7
- import { InjectAsyncQueue, InjectionSchemaField, InjectionBusinessCollector, InjectionChangeContextCollector, InjectionFormItemDepsCollector, InjectionFormUUID } from '../../../../packages/form-render/src/constants';
8
+ import { InjectAsyncQueue, InjectionSchemaField, InjectionBusinessCollector, InjectionChangeContextCollector, InjectionFormItemDepsCollector, InjectionFormUUID, InjectionAnnotation } from '../../../../packages/form-render/src/constants';
8
9
 
9
10
  function useFormContext(props) {
10
11
  const asyncQueue = injectOrProvide(InjectAsyncQueue, () => useAsyncQueue().create(props.parallelism));
@@ -23,6 +24,16 @@ function useFormContext(props) {
23
24
  provide(InjectionFormItemDepsCollector, formItemDepsCollector);
24
25
  const formUUID = props.uuid || uuidGenerator();
25
26
  provide(InjectionFormUUID, formUUID);
27
+ provide(InjectionAnnotation, computed({
28
+ get() {
29
+ return props.annotation ? readonly(props.annotation) : null;
30
+ },
31
+ set(payload) {
32
+ if (!isObject(props.annotation))
33
+ return;
34
+ props.annotation[payload.property] = payload.value;
35
+ }
36
+ }));
26
37
  return {
27
38
  asyncQueue,
28
39
  SchemaField,
@@ -12,6 +12,23 @@
12
12
  .form-render__formItem .n-date-picker {
13
13
  width: 100%;
14
14
  }
15
+ .form-render__formItemLabel {
16
+ position: relative;
17
+ display: flex;
18
+ align-items: center;
19
+ }
20
+ .form-render__formItemLabel--annotation {
21
+ position: absolute;
22
+ top: 0;
23
+ right: calc(var(--icon-right) * 1px);
24
+ cursor: pointer;
25
+ color: #0067ee;
26
+ font-size: 16px;
27
+ user-select: none;
28
+ }
29
+ .form-render__formItemLabel--annotation.is-active {
30
+ color: rgba(255, 152, 40);
31
+ }
15
32
  .form-render__linebar {
16
33
  grid-column: span var(--column) / span var(--column);
17
34
  }
@@ -97,3 +114,9 @@
97
114
  display: flex !important;
98
115
  gap: 0 8px;
99
116
  }
117
+ .form-render .n-form-item-label [form-item-hover-show='true'] {
118
+ visibility: hidden;
119
+ }
120
+ .form-render .n-form-item-label:hover [form-item-hover-show='true'] {
121
+ visibility: visible;
122
+ }
@@ -249,6 +249,11 @@ body > .vxe-table--tooltip-wrapper {
249
249
  height: 100%;
250
250
  line-height: unset;
251
251
  width: 100%;
252
+ display: inline-flex;
253
+ }
254
+ .custom-big-table .vxe-table .vxe-table--header .col--seq .vxe-cell--title,
255
+ .custom-big-table .vxe-table .vxe-table--header .col--checkbox .vxe-cell--title {
256
+ display: inline-block;
252
257
  }
253
258
  .custom-big-table .vxe-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar,
254
259
  .custom-big-table .vxe-table .vxe-table--body-wrapper::-webkit-scrollbar {
@@ -2647,6 +2652,23 @@ body > .vxe-table--tooltip-wrapper {
2647
2652
  .form-render__formItem .n-date-picker {
2648
2653
  width: 100%;
2649
2654
  }
2655
+ .form-render__formItemLabel {
2656
+ position: relative;
2657
+ display: flex;
2658
+ align-items: center;
2659
+ }
2660
+ .form-render__formItemLabel--annotation {
2661
+ position: absolute;
2662
+ top: 0;
2663
+ right: calc(var(--icon-right) * 1px);
2664
+ cursor: pointer;
2665
+ color: #0067ee;
2666
+ font-size: 16px;
2667
+ user-select: none;
2668
+ }
2669
+ .form-render__formItemLabel--annotation.is-active {
2670
+ color: rgba(255, 152, 40);
2671
+ }
2650
2672
  .form-render__linebar {
2651
2673
  grid-column: span var(--column) / span var(--column);
2652
2674
  }
@@ -2732,6 +2754,12 @@ body > .vxe-table--tooltip-wrapper {
2732
2754
  display: flex !important;
2733
2755
  gap: 0 8px;
2734
2756
  }
2757
+ .form-render .n-form-item-label [form-item-hover-show='true'] {
2758
+ visibility: hidden;
2759
+ }
2760
+ .form-render .n-form-item-label:hover [form-item-hover-show='true'] {
2761
+ visibility: visible;
2762
+ }
2735
2763
  .c-fabric-chart-popup-tip,
2736
2764
  .c-fabric-chart-popup-menu {
2737
2765
  position: absolute;
@@ -303,14 +303,10 @@ const ScaleViewInit = (props, state, emit, config) => {
303
303
  let i = 1;
304
304
  const results = list.map((item) => {
305
305
  const key = formKey(item);
306
- let title = (key || "").replace(/\n/g, "");
306
+ (key || "").replace(/\n/g, "");
307
307
  item.showTitle = item.title;
308
308
  item.val_key = key;
309
309
  item.renderCom = componentMap[item.type];
310
- if (title.includes(".")) {
311
- let newTitle = title.replace(/\./g, "~-~");
312
- item.showTitle = newTitle;
313
- }
314
310
  item.isShow = true;
315
311
  Object.keys(item).forEach((key2) => {
316
312
  if (vexutils.isJSON(item[key2])) {
@@ -82,12 +82,7 @@ const ScaleViewSubmit = (props, state, emit, config) => {
82
82
  if (itemTemp.setting && itemTemp.setting.dateType == "date" && tempObj[key])
83
83
  tempObj[key] = moment(tempObj[key]).format("YYYY-MM-DD ") + moment().format("HH:mm:ss");
84
84
  }
85
- if (key.includes("~-~")) {
86
- let newKey = keyTemp ? keyTemp.replace(/~-~/g, ".") : key.replace(/~-~/g, ".");
87
- res[newKey] = tempObj[key];
88
- } else {
89
- res[keyTemp || key] = !tempObj[key] ? null : tempObj[key];
90
- }
85
+ res[keyTemp || key] = !tempObj[key] ? null : tempObj[key];
91
86
  if (isOnlyOptions(itemTemp.type)) {
92
87
  let { options } = itemTemp;
93
88
  let useKey = itemTemp.val_key;
@@ -117,9 +117,6 @@ const ScaleViewValidate = (props, state, config) => {
117
117
  const rules = {};
118
118
  formArray.forEach((item) => {
119
119
  let newTitle = item.val_key;
120
- if (newTitle.includes(".")) {
121
- newTitle = newTitle.replace(/\./g, "~-~");
122
- }
123
120
  rules[newTitle] = [];
124
121
  if (item.required && !filterArr.includes(item.type)) {
125
122
  rules[newTitle].push({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
3
  "private": false,
4
- "version": "3.1.13-beta.3",
4
+ "version": "3.1.13-beta.4",
5
5
  "license": "ISC",
6
6
  "module": "es/packages/index.js",
7
7
  "main": "es/packages/index.js",
package/test.ts DELETED
@@ -1,326 +0,0 @@
1
- import { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
2
- const _hoisted_1 = {
3
- class: "markdown"
4
- };
5
-
6
- const _hoisted_2 = /*#__PURE__*/_createElementVNode("p", null, null, -1
7
- /* HOISTED */
8
- );
9
-
10
- const _hoisted_3 = /*#__PURE__*/_createElementVNode("h1", null, "信息展示头(CInfoHeader)", -1
11
- /* HOISTED */
12
- );
13
-
14
- const _hoisted_4 = ["innerHTML"];
15
-
16
- const _hoisted_5 = /*#__PURE__*/_createElementVNode("h2", null, "Props", -1
17
- /* HOISTED */
18
- );
19
-
20
- const _hoisted_6 = /*#__PURE__*/_createElementVNode("h2", null, "Emits", -1
21
- /* HOISTED */
22
- );
23
-
24
- const _hoisted_7 = /*#__PURE__*/_createElementVNode("h2", null, "Slots", -1
25
- /* HOISTED */
26
- );
27
-
28
- const _hoisted_8 = /*#__PURE__*/_createElementVNode("h2", null, "Expose", -1
29
- /* HOISTED */
30
- );
31
-
32
- export function render(_ctx, _cache) {
33
- const _component_Component0 = _resolveComponent("Component0");
34
-
35
- const _component_demo_collapse = _resolveComponent("demo-collapse");
36
-
37
- const _component_n_data_table = _resolveComponent("n-data-table");
38
-
39
- const _component_anchor_list = _resolveComponent("anchor-list");
40
-
41
- return _openBlock(), _createElementBlock("div", _hoisted_1, [_createVNode(_component_anchor_list, null, {
42
- default: _withCtx(() => [_hoisted_2, _hoisted_3, _createElementVNode("p", null, [_createVNode(_component_demo_collapse, null, {
43
- source: _withCtx(() => [_createElementVNode("pre", null, [_createElementVNode("code", {
44
- class: "hljs",
45
- innerHTML: _ctx.code__Component0
46
- }, null, 8
47
- /* PROPS */
48
- , _hoisted_4)])]),
49
- default: _withCtx(() => [_createVNode(_component_Component0)]),
50
- _: 1
51
- /* STABLE */
52
-
53
- })]), _hoisted_5, _createVNode(_component_n_data_table, {
54
- striped: "",
55
- size: "small",
56
- data: [{
57
- [`name`]: `compact`,
58
- [`type`]: `Boolean`,
59
- [`defaultValue`]: `-`,
60
- [`description`]: ` 是否为紧凑模式`
61
- }, {
62
- [`name`]: `separator`,
63
- [`type`]: `String`,
64
- [`defaultValue`]: `':'`,
65
- [`description`]: ` info区域分隔符`
66
- }, {
67
- [`name`]: `patientInfo`,
68
- [`type`]: `Object`,
69
- [`defaultValue`]: `() => ({})`,
70
- [`description`]: ` 患者信息`
71
- }, {
72
- [`name`]: `infoList`,
73
- [`type`]: `Array`,
74
- [`defaultValue`]: `-`,
75
- [`description`]: ` info区数据源`
76
- }, {
77
- [`name`]: `labelField`,
78
- [`type`]: `String`,
79
- [`defaultValue`]: `'label'`,
80
- [`description`]: ` info区数据源label字段`
81
- }, {
82
- [`name`]: `valueField`,
83
- [`type`]: `String`,
84
- [`defaultValue`]: `'value'`,
85
- [`description`]: ` info区数据源value字段`
86
- }, {
87
- [`name`]: `minColumnWidth`,
88
- [`type`]: `[String, Number]`,
89
- [`defaultValue`]: `240`,
90
- [`description`]: ` info区列最小宽度`
91
- }, {
92
- [`name`]: `rowHeight`,
93
- [`type`]: `[String, Number]`,
94
- [`defaultValue`]: `32`,
95
- [`description`]: ` info区行高`
96
- }],
97
- columns: [{
98
- [`title`]: `属性`,
99
- [`key`]: `name`
100
- }, {
101
- [`title`]: `类型`,
102
- [`key`]: `type`
103
- }, {
104
- [`title`]: `默认值`,
105
- [`key`]: `defaultValue`
106
- }, {
107
- [`title`]: `描述`,
108
- [`key`]: `description`
109
- }]
110
- }, null, 8
111
- /* PROPS */
112
- , ["data"]), _hoisted_6, _createVNode(_component_n_data_table, {
113
- striped: "",
114
- size: "small",
115
- data: [{
116
- [`name`]: `openPatientInfo`,
117
- [`description`]: ` 点击患者信息图标回调`
118
- }, {
119
- [`name`]: `fieldSet`,
120
- [`description`]: ` 点击修改field图标回调`
121
- }, {
122
- [`name`]: `update:compact`,
123
- [`description`]: ` 点击模式切换按钮回调`
124
- }],
125
- columns: [{
126
- [`title`]: `事件名`,
127
- [`key`]: `name`
128
- }, {
129
- [`title`]: `描述`,
130
- [`key`]: `description`
131
- }]
132
- }), _hoisted_7, _createVNode(_component_n_data_table, {
133
- striped: "",
134
- size: "small",
135
- data: [{
136
- [`name`]: `operation`,
137
- [`description`]: `-`
138
- }, {
139
- [`name`]: `patientModule`,
140
- [`description`]: `-`
141
- }, {
142
- [`name`]: `avatar`,
143
- [`description`]: `-`
144
- }, {
145
- [`name`]: `avatarInfo`,
146
- [`description`]: `-`
147
- }, {
148
- [`name`]: `info`,
149
- [`description`]: `-`
150
- }, {
151
- [`name`]: `setting`,
152
- [`description`]: `-`
153
- }, {
154
- [`name`]: `patientInfoIcon`,
155
- [`description`]: `-`
156
- }, {
157
- [`name`]: `fieldSetIcon`,
158
- [`description`]: `-`
159
- }, {
160
- [`name`]: `compactIcon`,
161
- [`description`]: `-`
162
- }],
163
- columns: [{
164
- [`title`]: `属性`,
165
- [`key`]: `name`
166
- }, {
167
- [`title`]: `描述`,
168
- [`key`]: `description`
169
- }]
170
- }), _hoisted_8, _createVNode(_component_n_data_table, {
171
- striped: "",
172
- size: "small",
173
- data: [{
174
- [`name`]: `update`,
175
- [`params`]: `-`,
176
- [`description`]: ` 手动触发info区域宽度重新计算`
177
- }],
178
- columns: [{
179
- [`title`]: `属性`,
180
- [`key`]: `name`
181
- }, {
182
- [`title`]: `参数`,
183
- [`key`]: `params`
184
- }, {
185
- [`title`]: `描述`,
186
- [`key`]: `description`
187
- }]
188
- })]),
189
- _: 1
190
- /* STABLE */
191
-
192
- })]);
193
- }
194
- import { defineComponent } from 'vue';
195
- import Component0 from "examples/views/6-info-header/demo/index.demo.vue";
196
- import hljs from 'highlight.js';
197
- import { NDataTable } from 'naive-ui';
198
-
199
- const __script = defineComponent({
200
- components: {
201
- Component0,
202
- NDataTable
203
- },
204
-
205
- setup() {
206
- const code__Component0 = hljs.highlight(`<!-- 整个组件从左到右分为 操作区 患者信息区 基本信息区 设置区 4个区域 -->
207
- <template>
208
- <!-- compact 表示组件是否为收缩状态 -->
209
- <!-- patientInfo 表示患者基本信息 -->
210
- <!-- infoList
211
- 1.表示基本信息区描述列表数据, 如果需要在描述列表的内容中使用插槽, 那么在单项中传入slot字段即可
212
- 2.同时, 组件会对label中包含 电话|身份证 的项进行特殊处理(点击眼睛图标隐藏)
213
- 3如果需要自己实现info区的内容, 使用info插槽即可
214
- -->
215
- <c-info-header
216
- v-model:compact="compact"
217
- :patientInfo="patientInfo"
218
- :infoList="infoList"
219
- min-column-width="180"
220
- @open-patient-info="onOpenPatientInfo"
221
- @field-set="onFieldSet"
222
- >
223
- <!-- 操作区插槽, 需要全量使用插槽实现 -->
224
- <template #operation>
225
- <div>operation1</div>
226
- <!-- 为组件中的元素添加 compact-hidden 属性后, 该元素将自动在紧凑模式下隐藏-->
227
- <div compact-hidden>operation2</div>
228
- </template>
229
-
230
- <!-- 患者信息区的头像插槽 -->
231
- <template #avatar>avatar</template>
232
-
233
- <!-- 患者信息区的底部描述插槽-->
234
- <template #avatarInfo>
235
- <div compact-hidden>avatarInfo</div>
236
- </template>
237
-
238
- <!-- 患者信息插槽, 需要自己实现整个患者信息区时使用, 一般情况不需要 -->
239
- <template #patientModule></template>
240
-
241
- <!-- 基本信息区插槽, 一般情况不需要 -->
242
- <template #info></template>
243
-
244
- <!-- 设置区插槽, 一般情况不需要 -->
245
- <!-- <template #setting></template>-->
246
-
247
- <!-- 信息区医师插槽,插槽名称由infoList中的配置指定,一般情况不需要 -->
248
- <template #doctor="{item,style,width}">
249
- <div :style="{color:'red',width:width+'px',maxWidth:width+'px',...style}">{{ item.value || '-' }}</div>
250
- </template>
251
- </c-info-header>
252
- </template>
253
-
254
- &#60;script lang="ts">
255
- import { defineComponent } from 'vue';
256
-
257
- export default defineComponent({
258
- setup() {
259
- import { ref, h } from 'vue';
260
-
261
- const compact = ref(false);
262
-
263
- const patientInfo = ref({
264
- name: '患者',
265
- sex: '男',
266
- age: '12',
267
- ageUnit: '月',
268
- tagList: [{ type: 'warning', content: '自费' }]
269
- });
270
-
271
- const infoList = ref([
272
- { "label": "电话", "value": "15625635269" },
273
- { "label": "门诊号", "value": "MZ103570", /* 指定内容区样式 */contentStyle: { color: 'red' } },
274
- { "label": "就诊号", "value": "R0000200658" },
275
- { "label": "医师", "value": "王烁", /* 指定该项的内容使用doctor插槽 */ slot: 'doctor' },
276
- { "label": "所在科室", "value": "社康(全科)" },
277
- {
278
- "label": "过敏史", "value": undefined,
279
- /**
280
- *
281
- * @param {Object} item --当前item
282
- * @param {number} width --组件计算所得的当前项的最大宽度,使用插槽后,需要自行实现ellipsis逻辑,否则宽度过长时会导致错位
283
- * @returns {VNode}
284
- */
285
- slot({ item, width }) {
286
- return h('div', { style: { color: 'red', width: width + 'px', maxWidth: width + 'px' } }, item.value);
287
- }
288
- },
289
- { "label": "血压", "value": null },
290
- { "label": "基本余额", "value": null },
291
- { "label": "积分", "value": null }
292
- ]);
293
-
294
- function onOpenPatientInfo() {
295
- // ...
296
- }
297
-
298
- function onFieldSet() {
299
- // ...
300
- }
301
-
302
- return { compact, onFieldSet, onOpenPatientInfo, patientInfo, infoList };
303
- }
304
- });
305
- &#60;/script>
306
- `.replace(/&#60;/g, '<'), {
307
- language: 'xml'
308
- }).value;
309
- return {
310
- code__Component0
311
- };
312
- }
313
-
314
- });
315
-
316
- __script.render = render;
317
- export default __script;
318
- __script.__hmrId = "75d252c3";
319
-
320
- __VUE_HMR_RUNTIME__.createRecord("75d252c3", __script);
321
-
322
- import.meta.hot.accept(({
323
- default: __default
324
- }) => {
325
- __VUE_HMR_RUNTIME__.reload("75d252c3", __default);
326
- });