cnhis-design-vue 3.1.8-beta.6 → 3.1.8-beta.9

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.
@@ -1391,7 +1391,22 @@ declare const _default: import("vue").DefineComponent<{
1391
1391
  maxWidth: NumberConstructor;
1392
1392
  }, {
1393
1393
  popoverRef: import("vue").Ref<{
1394
- syncPosition: () => void;
1394
+ syncPosition: () => void; /**
1395
+ * 针对 bigTable 的设置列
1396
+ * type: 列的类型
1397
+ * field: 列字段名(注:属性层级越深,渲染性能将直线下降)
1398
+ * title: 列标题(支持开启国际化)
1399
+ * width: 列宽度(如果为空则均匀分配剩余宽度,如果全部列固定了,可能会存在宽屏下不会铺满,可以配合 "%" 或者 "min-width" 布局)
1400
+ * minWidth: 最小列宽度;会自动将剩余空间按比例分配
1401
+ * resizable: 列是否允许拖动列宽调整大小
1402
+ * visible: 列是否显示
1403
+ * fixed: 将列固定在左侧或者右侧(注意:固定列应该放在左右两侧的位置)
1404
+ * align: 列对齐方式
1405
+ * headerAlign: 表头列的对齐方式
1406
+ * footerAlign: 表尾列的对齐方式
1407
+ * formatter: 格式化显示内容 Function({cellValue, row, column})
1408
+ * sortable: 是否允许列排序
1409
+ */
1395
1410
  setShow: (value: boolean) => void;
1396
1411
  } | null>;
1397
1412
  mergedTheme: import("vue").ComputedRef<{
@@ -288,9 +288,10 @@ var script = /* @__PURE__ */ defineComponent({
288
288
  if (state.isTree != 3)
289
289
  return;
290
290
  let table = xGrid.value;
291
- let key = (_a = table.getTableColumn().tableColumn) == null ? void 0 : _a.find((column) => {
291
+ let obj = (_a = table.getTableColumn().tableColumn) == null ? void 0 : _a.find((column) => {
292
292
  return !!column.property;
293
- }).property;
293
+ });
294
+ let key = (obj == null ? void 0 : obj.property) || "";
294
295
  setTreeGroupTitle(formatList, key, GROUP_TITLE_KEY);
295
296
  };
296
297
  const setCurrentPageRowChecked = () => {
@@ -1680,7 +1681,7 @@ var script = /* @__PURE__ */ defineComponent({
1680
1681
  }, [createVNode("div", {
1681
1682
  "style": {
1682
1683
  background: color,
1683
- height: "100%"
1684
+ height: "24px"
1684
1685
  }
1685
1686
  }, null)])];
1686
1687
  };
@@ -87,6 +87,10 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
87
87
  type: import("vue").PropType<import("cnhis-design-vue/es/src/types").AnyObject>;
88
88
  default: () => {};
89
89
  };
90
+ consumer: {
91
+ type: BooleanConstructor;
92
+ default: boolean;
93
+ };
90
94
  }, {
91
95
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
92
96
  fieldList: {
@@ -174,6 +178,10 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
174
178
  type: import("vue").PropType<import("cnhis-design-vue/es/src/types").AnyObject>;
175
179
  default: () => {};
176
180
  };
181
+ consumer: {
182
+ type: BooleanConstructor;
183
+ default: boolean;
184
+ };
177
185
  }>> & {
178
186
  onFormChange?: ((...args: any[]) => any) | undefined;
179
187
  }>>;
@@ -304,6 +312,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
304
312
  FormProvider: import("vue").DefineComponent<Record<"form", any>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Record<"form", any>>>, {
305
313
  form: any;
306
314
  }>;
315
+ FormConsumer: import("vue").DefineComponent<{}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
307
316
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "formChange"[], "formChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
308
317
  fieldList: {
309
318
  type: import("vue").PropType<import("./src/types").FieldItem[]>;
@@ -390,6 +399,10 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
390
399
  type: import("vue").PropType<import("cnhis-design-vue/es/src/types").AnyObject>;
391
400
  default: () => {};
392
401
  };
402
+ consumer: {
403
+ type: BooleanConstructor;
404
+ default: boolean;
405
+ };
393
406
  }>> & {
394
407
  onFormChange?: ((...args: any[]) => any) | undefined;
395
408
  }, {
@@ -398,5 +411,6 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
398
411
  initialData: import("cnhis-design-vue/es/src/types").AnyObject;
399
412
  parallelism: number;
400
413
  scope: import("cnhis-design-vue/es/src/types").AnyObject;
414
+ consumer: boolean;
401
415
  }>>;
402
416
  export default FormRender;
@@ -1,6 +1,6 @@
1
1
  import { AnyObject } from 'cnhis-design-vue/es/src/types';
2
- import { FieldItem, FieldVisitor } from "./types";
3
- import { Component, FunctionalComponent, PropType } from "vue";
2
+ import { FieldItem, FieldVisitor } from './types';
3
+ import { Component, FunctionalComponent, PropType } from 'vue';
4
4
  declare const _default: import("vue").DefineComponent<{
5
5
  fieldList: {
6
6
  type: PropType<FieldItem[]>;
@@ -87,6 +87,10 @@ declare const _default: import("vue").DefineComponent<{
87
87
  type: PropType<AnyObject>;
88
88
  default: () => {};
89
89
  };
90
+ consumer: {
91
+ type: BooleanConstructor;
92
+ default: boolean;
93
+ };
90
94
  }, {
91
95
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
92
96
  fieldList: {
@@ -174,6 +178,10 @@ declare const _default: import("vue").DefineComponent<{
174
178
  type: PropType<AnyObject>;
175
179
  default: () => {};
176
180
  };
181
+ consumer: {
182
+ type: BooleanConstructor;
183
+ default: boolean;
184
+ };
177
185
  }>> & {
178
186
  onFormChange?: ((...args: any[]) => any) | undefined;
179
187
  }>>;
@@ -304,6 +312,7 @@ declare const _default: import("vue").DefineComponent<{
304
312
  FormProvider: import("vue").DefineComponent<Record<"form", any>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Record<"form", any>>>, {
305
313
  form: any;
306
314
  }>;
315
+ FormConsumer: import("vue").DefineComponent<{}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
307
316
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "formChange"[], "formChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
308
317
  fieldList: {
309
318
  type: PropType<FieldItem[]>;
@@ -390,6 +399,10 @@ declare const _default: import("vue").DefineComponent<{
390
399
  type: PropType<AnyObject>;
391
400
  default: () => {};
392
401
  };
402
+ consumer: {
403
+ type: BooleanConstructor;
404
+ default: boolean;
405
+ };
393
406
  }>> & {
394
407
  onFormChange?: ((...args: any[]) => any) | undefined;
395
408
  }, {
@@ -398,5 +411,6 @@ declare const _default: import("vue").DefineComponent<{
398
411
  initialData: AnyObject;
399
412
  parallelism: number;
400
413
  scope: AnyObject;
414
+ consumer: boolean;
401
415
  }>;
402
416
  export default _default;
@@ -1,15 +1,16 @@
1
- import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, createVNode, unref, withCtx, renderSlot } from 'vue';
1
+ import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, createVNode, unref, withCtx, renderSlot, createBlock, createElementVNode, toDisplayString, createCommentVNode } from 'vue';
2
2
  import { injectOrProvide } from './utils/index.mjs';
3
3
  import { cloneDeep } from 'lodash-es';
4
4
  import { InjectionBusinessCollector, InjectAsyncQueue, InjectionSchemaField } from './constants/index.mjs';
5
5
  import * as index from './components/index.mjs';
6
6
  import { createForm, onFieldValueChange } from '@formily/core';
7
- import { FormProvider, createSchemaField } from '@formily/vue';
7
+ import { FormProvider, FormConsumer, createSchemaField } from '@formily/vue';
8
8
  import { useBusinessBinding } from './hooks/useBusinessBinding.mjs';
9
9
  import { useAsyncQueue } from './hooks/useAsyncQueue.mjs';
10
10
  import { useFieldVisitor } from './hooks/useFieldVisitor.mjs';
11
11
  import { useFieldList2Schema } from './hooks/useFieldList2Schema.mjs';
12
12
 
13
+ const _hoisted_1 = { style: { "white-space": "pre" } };
13
14
  var script = /* @__PURE__ */ defineComponent({
14
15
  __name: "FormRender",
15
16
  props: {
@@ -23,9 +24,12 @@ var script = /* @__PURE__ */ defineComponent({
23
24
  type: Object,
24
25
  default: () => ({})
25
26
  },
26
- scope: { type: Object, default: () => ({}) }
27
+ scope: { type: Object, default: () => ({}) },
28
+ consumer: { type: Boolean, default: false }
27
29
  },
28
- emits: ["formChange"],
30
+ emits: [
31
+ "formChange"
32
+ ],
29
33
  setup(__props, { expose, emit }) {
30
34
  const props = __props;
31
35
  const { create, trigger } = useBusinessBinding();
@@ -79,7 +83,13 @@ var script = /* @__PURE__ */ defineComponent({
79
83
  default: withCtx(() => [
80
84
  renderSlot(_ctx.$slots, "default", { schemaFiled: unref(SchemaField) }, () => [
81
85
  createVNode(unref(SchemaField), { schema: unref(renderSchema) }, null, 8, ["schema"])
82
- ])
86
+ ]),
87
+ __props.consumer ? (openBlock(), createBlock(unref(FormConsumer), { key: 0 }, {
88
+ default: withCtx(({ form }) => [
89
+ createElementVNode("div", _hoisted_1, toDisplayString(JSON.stringify(form.values, null, 2)), 1)
90
+ ]),
91
+ _: 1
92
+ })) : createCommentVNode("v-if", true)
83
93
  ]),
84
94
  _: 3
85
95
  }, 8, ["form"])
@@ -0,0 +1,13 @@
1
+ export declare const COMPLEX: import("vue").DefineComponent<{
2
+ span: {
3
+ type: NumberConstructor;
4
+ default: number;
5
+ };
6
+ }, () => 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<{
7
+ span: {
8
+ type: NumberConstructor;
9
+ default: number;
10
+ };
11
+ }>>, {
12
+ span: number;
13
+ }>;
@@ -0,0 +1,31 @@
1
+ import { defineComponent, createVNode } from 'vue';
2
+ import { connect, mapProps } from '@formily/vue';
3
+ import { assignUpdateValue } from 'cnhis-design-vue/es/packages/form-render/src/utils';
4
+
5
+ const script = defineComponent({
6
+ props: {
7
+ span: {
8
+ type: Number,
9
+ default: 6
10
+ }
11
+ },
12
+ setup(props, {
13
+ slots,
14
+ attrs
15
+ }) {
16
+ function onChange(e) {
17
+ e.stopPropagation();
18
+ }
19
+ return () => {
20
+ return createVNode("section", {
21
+ "class": "form-render__complex"
22
+ }, [createVNode("section", {
23
+ "class": "form-render__complexContent",
24
+ "onChange": onChange
25
+ }, [slots.default && slots.default()])]);
26
+ };
27
+ }
28
+ });
29
+ const COMPLEX = connect(script, mapProps(assignUpdateValue));
30
+
31
+ export { COMPLEX };
@@ -13,3 +13,4 @@ export * from './switch';
13
13
  export * from './radio';
14
14
  export * from './labelSelect';
15
15
  export * from './slider';
16
+ export * from './complex';
@@ -13,3 +13,4 @@ export { SWITCH } from './switch.mjs';
13
13
  export { RADIO } from './radio.mjs';
14
14
  export { LABEL } from './labelSelect.mjs';
15
15
  export { SLIDER } from './slider.mjs';
16
+ export { COMPLEX } from './complex.mjs';
@@ -1,6 +1,6 @@
1
- import { BusinessCollector } from "../hooks";
2
- import { FormAsyncQueue } from "../types";
3
- import { Component, InjectionKey } from "vue";
1
+ import { BusinessCollector } from '../hooks';
2
+ import { FormAsyncQueue } from '../types';
3
+ import { Component, InjectionKey } from 'vue';
4
4
  export declare const InjectAsyncQueue: InjectionKey<FormAsyncQueue>;
5
5
  export declare const InjectionSchemaField: InjectionKey<Component>;
6
6
  export declare const InjectionBusinessCollector: InjectionKey<BusinessCollector>;
@@ -11,6 +11,8 @@ export declare enum FIELD_BUSINESS_TYPE {
11
11
  MOBILE = "mobile",
12
12
  TELEPHONE = "telephone",
13
13
  EMAIL = "email",
14
+ SEX = "sex",
15
+ BIRTHDAY = "birthday",
14
16
  BANK_CARD = "bank_card",
15
17
  WEBSITE = "website",
16
18
  GESTATIONAL_WEEKS = "gestational_weeks",
@@ -8,6 +8,8 @@ var FIELD_BUSINESS_TYPE = /* @__PURE__ */ ((FIELD_BUSINESS_TYPE2) => {
8
8
  FIELD_BUSINESS_TYPE2["MOBILE"] = "mobile";
9
9
  FIELD_BUSINESS_TYPE2["TELEPHONE"] = "telephone";
10
10
  FIELD_BUSINESS_TYPE2["EMAIL"] = "email";
11
+ FIELD_BUSINESS_TYPE2["SEX"] = "sex";
12
+ FIELD_BUSINESS_TYPE2["BIRTHDAY"] = "birthday";
11
13
  FIELD_BUSINESS_TYPE2["BANK_CARD"] = "bank_card";
12
14
  FIELD_BUSINESS_TYPE2["WEBSITE"] = "website";
13
15
  FIELD_BUSINESS_TYPE2["GESTATIONAL_WEEKS"] = "gestational_weeks";
@@ -1,5 +1,5 @@
1
- import { Form } from "@formily/core";
2
- import { FIELD_BUSINESS_TYPE } from "../constants";
1
+ import { Form } from '@formily/core';
2
+ import { FIELD_BUSINESS_TYPE } from '../constants';
3
3
  export declare class BusinessCollector {
4
4
  typeCollector: Map<FIELD_BUSINESS_TYPE, Set<string>>;
5
5
  fieldNameCollector: Map<string, FIELD_BUSINESS_TYPE>;
@@ -34,6 +34,18 @@ function useBusinessBinding() {
34
34
  state.value = info.age;
35
35
  });
36
36
  });
37
+ const sexFields = collector.getField(FIELD_BUSINESS_TYPE.SEX);
38
+ sexFields.forEach((field) => {
39
+ formModel.setFieldState(field, (state) => {
40
+ state.value = info.sex;
41
+ });
42
+ });
43
+ const birthdayFields = collector.getField(FIELD_BUSINESS_TYPE.BIRTHDAY);
44
+ birthdayFields.forEach((field) => {
45
+ formModel.setFieldState(field, (state) => {
46
+ state.value = info.birthday;
47
+ });
48
+ });
37
49
  }
38
50
  const handlerMap = /* @__PURE__ */ new Map([[FIELD_BUSINESS_TYPE.ID_CARD, handlerIdCardType]]);
39
51
  function trigger(collector, formModel, fieldName, value) {
@@ -109,6 +109,7 @@ function useFieldList2Schema(collector) {
109
109
  };
110
110
  const createCustomSchema = (item) => {
111
111
  const schema = createStandardSchema(item);
112
+ item.fieldType && (schema.type = item.fieldType);
112
113
  Object.assign(schema["x-component-props"], {
113
114
  fieldItem: item
114
115
  });
@@ -126,6 +127,13 @@ function useFieldList2Schema(collector) {
126
127
  }
127
128
  };
128
129
  };
130
+ const createComplexSchema = (item) => {
131
+ const schema = createStandardSchema(item);
132
+ const properties = Array.isArray(item.properties) ? transform(item.properties) : {};
133
+ schema.type = item.fieldType || "void";
134
+ schema.properties = properties;
135
+ return schema;
136
+ };
129
137
  const creatorMap = /* @__PURE__ */ new Map([
130
138
  ["LINEBAR", createCollapseSchema],
131
139
  ["INPUT", createInputSchema],
@@ -137,7 +145,8 @@ function useFieldList2Schema(collector) {
137
145
  ["RADIO", createRadioSchema],
138
146
  ["CHECKBOX", createRadioSchema],
139
147
  ["SWITCH", createSwitchSchema],
140
- ["SLIDER", createSliderSchema]
148
+ ["SLIDER", createSliderSchema],
149
+ ["COMPLEX", createComplexSchema]
141
150
  ]);
142
151
  const createWidgetSchema = (item) => {
143
152
  if (item.suffixConfig)
@@ -40,6 +40,8 @@ export declare type FieldItem = {
40
40
  wordbook?: AnyObject;
41
41
  suFieldList?: any[];
42
42
  bindEventSetting?: Ievent[];
43
+ fieldType: 'string' | 'object' | 'array' | 'number' | 'void' | 'boolean' | 'datetime';
44
+ properties: FieldItem[];
43
45
  [key: string]: any;
44
46
  }>;
45
47
  export {};
@@ -82,3 +82,11 @@
82
82
  .form-render__combinationContent {
83
83
  position: relative;
84
84
  }
85
+ .form-render__complex {
86
+ width: 100%;
87
+ }
88
+ .form-render__complexContent {
89
+ display: grid !important;
90
+ grid-template-columns: repeat(var(--column), minmax(0px, 1fr));
91
+ gap: 0 8px;
92
+ }
@@ -118,4 +118,12 @@
118
118
  position: relative;
119
119
  }
120
120
  }
121
+
122
+ &__complex {
123
+ width: 100%;
124
+
125
+ &Content {
126
+ @display();
127
+ }
128
+ }
121
129
  }
@@ -2672,3 +2672,11 @@ body > .vxe-table--tooltip-wrapper {
2672
2672
  .form-render__combinationContent {
2673
2673
  position: relative;
2674
2674
  }
2675
+ .form-render__complex {
2676
+ width: 100%;
2677
+ }
2678
+ .form-render__complexContent {
2679
+ display: grid !important;
2680
+ grid-template-columns: repeat(var(--column), minmax(0px, 1fr));
2681
+ gap: 0 8px;
2682
+ }
@@ -3062,5 +3062,13 @@ body {
3062
3062
  position: relative;
3063
3063
  }
3064
3064
  }
3065
+
3066
+ &__complex {
3067
+ width: 100%;
3068
+
3069
+ &Content {
3070
+ @display();
3071
+ }
3072
+ }
3065
3073
  }
3066
3074
 
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, nextTick, onMounted, watch, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, Fragment, toDisplayString, createCommentVNode, renderList, withDirectives, createBlock, unref, withCtx, createTextVNode, vShow, createVNode } from 'vue';
1
+ import { defineComponent, ref, nextTick, onMounted, watch, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createCommentVNode, Fragment, toDisplayString, renderList, withDirectives, createBlock, unref, withCtx, createTextVNode, vShow, createVNode } from 'vue';
2
2
  import { NTag, NDescriptions, NDescriptionsItem, NEllipsis } from 'naive-ui';
3
3
  import { useThrottleFn, useEventListener } from '@vueuse/core';
4
4
  import SlotRender from './SlotRender.mjs';
@@ -6,7 +6,10 @@ import './HiddenContent.mjs';
6
6
  import script$1 from './HiddenContent.vue_vue_type_script_setup_true_lang.mjs';
7
7
 
8
8
  const _hoisted_1 = { class: "c-info-header__operation" };
9
- const _hoisted_2 = /* @__PURE__ */ createElementVNode("div", { class: "c-info-header__divider" }, null, -1);
9
+ const _hoisted_2 = {
10
+ key: 0,
11
+ class: "c-info-header__divider"
12
+ };
10
13
  const _hoisted_3 = { class: "c-info-header__patient" };
11
14
  const _hoisted_4 = { class: "c-info-header__patientHeader" };
12
15
  const _hoisted_5 = {
@@ -37,7 +40,11 @@ var script = /* @__PURE__ */ defineComponent({
37
40
  minColumnWidth: { type: [String, Number], default: 240 },
38
41
  rowHeight: { type: [String, Number], default: 32 }
39
42
  },
40
- emits: ["openPatientInfo", "fieldSet", "update:compact"],
43
+ emits: [
44
+ "openPatientInfo",
45
+ "fieldSet",
46
+ "update:compact"
47
+ ],
41
48
  setup(__props, { expose, emit }) {
42
49
  const props = __props;
43
50
  function toggleCompact() {
@@ -99,7 +106,7 @@ var script = /* @__PURE__ */ defineComponent({
99
106
  createElementVNode("section", _hoisted_1, [
100
107
  renderSlot(_ctx.$slots, "operation")
101
108
  ]),
102
- _hoisted_2,
109
+ _ctx.$slots.operation ? (openBlock(), createElementBlock("div", _hoisted_2)) : createCommentVNode("v-if", true),
103
110
  createElementVNode("section", _hoisted_3, [
104
111
  renderSlot(_ctx.$slots, "patientModule"),
105
112
  !_ctx.$slots.avatarModule ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
3
  "private": false,
4
- "version": "3.1.8-beta.6",
4
+ "version": "3.1.8-beta.9",
5
5
  "license": "ISC",
6
6
  "module": "es/packages/index.mjs",
7
7
  "main": "es/packages/index.mjs",