cnhis-design-vue 3.1.9-beta.10 → 3.1.9-beta.11
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.
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/packages/form-render/index.d.ts +2 -2
- package/es/packages/form-render/src/FormRender.vue.d.ts +3 -3
- package/es/packages/form-render/src/FormRender.vue_vue_type_script_setup_true_lang.js +14 -5
- package/es/packages/form-render/src/components/cascader.js +0 -1
- package/es/packages/form-render/src/hooks/useAsyncQueue.js +1 -1
- package/es/packages/form-render/src/hooks/useFieldList2Schema.js +1 -1
- package/es/packages/form-render/src/hooks/useFormField.js +1 -3
- package/es/packages/form-render/src/types/index.d.ts +1 -1
- package/es/packages/form-render/style/index.css +1 -1
- package/es/packages/index.css +1 -1
- package/es/packages/scale-view/src/components/formitem/r-datetime.js +2 -1
- package/es/src/assets/img/failure.d.ts +2 -1
- package/es/src/assets/img/icon-asc.d.ts +2 -1
- package/es/src/assets/img/icon-desc.d.ts +2 -1
- package/es/src/assets/img/no-permission.d.ts +2 -1
- package/es/src/assets/img/nodata.d.ts +2 -1
- package/es/src/assets/img/notfound.d.ts +2 -1
- package/es/src/assets/img/qr.d.ts +2 -1
- package/es/src/assets/img/success.d.ts +2 -1
- package/es/src/assets/img/video.d.ts +2 -1
- package/es/src/assets/img/video_default_cover.d.ts +2 -1
- package/es/src/assets/img/video_hover.d.ts +2 -1
- package/es/src/assets/img/video_play_hover.d.ts +2 -1
- package/es/src/assets/img/xb_big.d.ts +2 -1
- package/es/src/assets/img/xb_small.d.ts +2 -1
- package/package.json +1 -1
- package/test.ts +326 -0
- package/es/packages/big-table/style/index.less +0 -551
- package/es/packages/bpmn-workflow/style/index.less +0 -29
- package/es/packages/button-print/style/index.less +0 -30
- package/es/packages/chunk-upload/style/index.less +0 -395
- package/es/packages/drag-layout/style/index.less +0 -208
- package/es/packages/editor/style/index.less +0 -0
- package/es/packages/fabric-chart/style/index.less +0 -0
- package/es/packages/field-set/style/index.less +0 -157
- package/es/packages/form-render/style/index.less +0 -129
- package/es/packages/form-table/style/index.less +0 -301
- package/es/packages/grid/style/index.less +0 -13
- package/es/packages/index.less +0 -3069
- package/es/packages/info-header/style/index.less +0 -149
- package/es/packages/map/style/index.less +0 -60
- package/es/packages/scale-view/style/index.less +0 -753
- package/es/packages/select-label/style/index.less +0 -151
- package/es/packages/select-person/style/index.less +0 -229
- package/es/packages/time-line/style/index.less +0 -35
|
@@ -1258,7 +1258,7 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
1258
1258
|
let forbiddenBatchSelect = !checkMethod(data);
|
|
1259
1259
|
if (state.selectType == "checkbox" && forbiddenBatchSelect) {
|
|
1260
1260
|
table == null ? void 0 : table.setAllCheckboxRow(false);
|
|
1261
|
-
const checked2 = getRowClassName(
|
|
1261
|
+
const checked2 = getRowClassName({
|
|
1262
1262
|
row
|
|
1263
1263
|
}) == "single--checked";
|
|
1264
1264
|
const value = !checked2 ? [] : [row];
|
|
@@ -308,11 +308,11 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
308
308
|
"x-read-pretty"?: boolean | undefined;
|
|
309
309
|
"x-compile-omitted"?: string[] | undefined;
|
|
310
310
|
}>>;
|
|
311
|
-
validate: () =>
|
|
311
|
+
validate: () => Promise<void>;
|
|
312
|
+
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<{}>>, {}>;
|
|
312
313
|
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>>>, {
|
|
313
314
|
form: any;
|
|
314
315
|
}>;
|
|
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<{}>>, {}>;
|
|
316
316
|
NForm: import("vue").DefineComponent<{
|
|
317
317
|
readonly inline: BooleanConstructor;
|
|
318
318
|
readonly labelWidth: import("vue").PropType<string | number>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyObject } from '../../../../es/src/types';
|
|
2
|
-
import { FieldItem, FieldVisitor } from './types';
|
|
3
2
|
import { Component, FunctionalComponent, PropType } from 'vue';
|
|
3
|
+
import { FieldItem, FieldVisitor } from './types';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
|
5
5
|
fieldList: {
|
|
6
6
|
type: PropType<FieldItem[]>;
|
|
@@ -308,11 +308,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
308
308
|
"x-read-pretty"?: boolean | undefined;
|
|
309
309
|
"x-compile-omitted"?: string[] | undefined;
|
|
310
310
|
}>>;
|
|
311
|
-
validate: () =>
|
|
311
|
+
validate: () => Promise<void>;
|
|
312
|
+
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<{}>>, {}>;
|
|
312
313
|
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>>>, {
|
|
313
314
|
form: any;
|
|
314
315
|
}>;
|
|
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<{}>>, {}>;
|
|
316
316
|
NForm: import("vue").DefineComponent<{
|
|
317
317
|
readonly inline: BooleanConstructor;
|
|
318
318
|
readonly labelWidth: PropType<string | number>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent, provide, computed, openBlock, createBlock, unref, normalizeStyle, withCtx, createVNode, renderSlot, createElementVNode, toDisplayString, createCommentVNode } from 'vue';
|
|
2
|
-
import { injectOrProvide } from './utils/index.js';
|
|
3
|
-
import { cloneDeep } from 'lodash-es';
|
|
4
|
-
import { InjectionBusinessCollector, InjectionChangeContextCollector, InjectionFormItemDepsCollector, InjectAsyncQueue, InjectionSchemaField } from './constants/index.js';
|
|
5
|
-
import * as index from './components/index.js';
|
|
6
2
|
import { createForm, onFieldValueChange } from '@formily/core';
|
|
7
3
|
import { FormProvider, FormConsumer, createSchemaField } from '@formily/vue';
|
|
4
|
+
import { cloneDeep } from 'lodash-es';
|
|
8
5
|
import { NForm } from 'naive-ui';
|
|
6
|
+
import * as index from './components/index.js';
|
|
7
|
+
import { InjectionBusinessCollector, InjectionChangeContextCollector, InjectionFormItemDepsCollector, InjectAsyncQueue, InjectionSchemaField } from './constants/index.js';
|
|
8
|
+
import { injectOrProvide } from './utils/index.js';
|
|
9
9
|
import { useBusinessBinding } from './hooks/useBusinessBinding.js';
|
|
10
10
|
import { useAsyncQueue } from './hooks/useAsyncQueue.js';
|
|
11
11
|
import { useChangeContext } from './hooks/useChangeContext.js';
|
|
@@ -76,7 +76,16 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
76
76
|
return { type: "object", properties: {} };
|
|
77
77
|
});
|
|
78
78
|
function validate() {
|
|
79
|
-
return formModel.validate()
|
|
79
|
+
return formModel.validate().catch((err) => {
|
|
80
|
+
if (Array.isArray(err)) {
|
|
81
|
+
return Promise.reject(err.map((e) => {
|
|
82
|
+
e.title = formModel.query(e.path).get("title");
|
|
83
|
+
return e;
|
|
84
|
+
}));
|
|
85
|
+
} else {
|
|
86
|
+
return Promise.reject(err);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
80
89
|
}
|
|
81
90
|
expose({
|
|
82
91
|
validate,
|
|
@@ -120,7 +120,7 @@ function useAsyncQueue() {
|
|
|
120
120
|
const res = await http[method](url, params);
|
|
121
121
|
const { data, success } = res;
|
|
122
122
|
if (!success)
|
|
123
|
-
throw
|
|
123
|
+
throw res;
|
|
124
124
|
cb(void 0, data);
|
|
125
125
|
} catch (e) {
|
|
126
126
|
cb(new Error(`Request error => ${e}`));
|
|
@@ -157,7 +157,7 @@ function useFieldList2Schema(collector) {
|
|
|
157
157
|
const createWidgetCombinationSchema = (item) => {
|
|
158
158
|
const suffixList = arrayed(item.suffixConfig);
|
|
159
159
|
const fieldList = [{ ...item, suffixConfig: void 0 }].concat(suffixList.map((suffix) => {
|
|
160
|
-
return { ...suffix, is_show:
|
|
160
|
+
return { ...suffix, is_show: item.is_show, alias: " " };
|
|
161
161
|
}));
|
|
162
162
|
return {
|
|
163
163
|
type: "void",
|
|
@@ -20,7 +20,7 @@ export interface FormAsyncQueueItem {
|
|
|
20
20
|
export declare type FormAsyncQueue = AsyncQueue<FormAsyncQueueItem, any, AnyObject[]>;
|
|
21
21
|
export declare type IdCardParseInfo = Record<'sex' | 'birthday', string> & Record<'age' | 'day' | 'month' | 'year', number>;
|
|
22
22
|
export declare type FormRenderExpose = {
|
|
23
|
-
validate(): Promise<
|
|
23
|
+
validate(): Promise<void>;
|
|
24
24
|
getFormValues(): AnyObject;
|
|
25
25
|
setFieldState(path: string, setter: (field: Field) => void): void;
|
|
26
26
|
};
|
package/es/packages/index.css
CHANGED
|
@@ -2617,7 +2617,7 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
2617
2617
|
.form-render__inputGroup {
|
|
2618
2618
|
grid-column: span var(--column) / span var(--column);
|
|
2619
2619
|
display: flex;
|
|
2620
|
-
align-items: flex-
|
|
2620
|
+
align-items: flex-start;
|
|
2621
2621
|
}
|
|
2622
2622
|
.form-render__inputGroup > div {
|
|
2623
2623
|
flex: 1;
|
|
@@ -40,8 +40,9 @@ var scriptDatetime = defineComponent({
|
|
|
40
40
|
return "daterange";
|
|
41
41
|
});
|
|
42
42
|
const defaultValue = (val) => {
|
|
43
|
+
console.log(val, "time---val---");
|
|
43
44
|
vexutils.isJSON(val) && (val = JSON.parse(val));
|
|
44
|
-
if (vexutils.isEmpty(val))
|
|
45
|
+
if (!val || vexutils.isEmpty(val))
|
|
45
46
|
return;
|
|
46
47
|
let value = JSON.parse(JSON.stringify(val));
|
|
47
48
|
if (type === "TIME" || dateType == "time") {
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
type source = string;
|
|
1
|
+
type source = string;
|
|
2
|
+
export default source;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
type source = string;
|
|
1
|
+
type source = string;
|
|
2
|
+
export default source;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
type source = string;
|
|
1
|
+
type source = string;
|
|
2
|
+
export default source;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
type source = string;
|
|
1
|
+
type source = string;
|
|
2
|
+
export default source;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
type source = string;
|
|
1
|
+
type source = string;
|
|
2
|
+
export default source;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
type source = string;
|
|
1
|
+
type source = string;
|
|
2
|
+
export default source;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
type source = string;
|
|
1
|
+
type source = string;
|
|
2
|
+
export default source;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
type source = string;
|
|
1
|
+
type source = string;
|
|
2
|
+
export default source;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
type source = string;
|
|
1
|
+
type source = string;
|
|
2
|
+
export default source;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
type source = string;
|
|
1
|
+
type source = string;
|
|
2
|
+
export default source;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
type source = string;
|
|
1
|
+
type source = string;
|
|
2
|
+
export default source;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
type source = string;
|
|
1
|
+
type source = string;
|
|
2
|
+
export default source;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
type source = string;
|
|
1
|
+
type source = string;
|
|
2
|
+
export default source;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
type source = string;
|
|
1
|
+
type source = string;
|
|
2
|
+
export default source;
|
package/package.json
CHANGED
package/test.ts
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
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
|
+
<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
|
+
</script>
|
|
306
|
+
`.replace(/</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
|
+
});
|