cnhis-design-vue 3.1.13-beta.2 → 3.1.13-beta.5
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.d.ts +8 -5
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +26 -18
- package/es/packages/big-table/src/utils.js +2 -1
- package/es/packages/big-table/style/index.css +5 -0
- package/es/packages/bpmn-workflow/src/BpmnWorkflow.d.ts +5 -0
- package/es/packages/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/packages/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/packages/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/packages/fabric-chart/src/hooks/useCenter.js +58 -2
- package/es/packages/fabric-chart/src/hooks/useDraw.d.ts +1 -1
- package/es/packages/fabric-chart/src/hooks/useDraw.js +59 -6
- package/es/packages/fabric-chart/src/hooks/useOther.js +3 -2
- package/es/packages/fabric-chart/src/interface.d.ts +1 -0
- package/es/packages/fabric-chart/src/utils/index.d.ts +6823 -2
- package/es/packages/form-render/index.d.ts +9 -0
- package/es/packages/form-render/src/FormRender.vue.d.ts +9 -0
- package/es/packages/form-render/src/FormRender.vue_vue_type_script_setup_true_lang.js +2 -1
- package/es/packages/form-render/src/components/renderer/formItem.d.ts +8 -293
- package/es/packages/form-render/src/components/renderer/formItem.js +135 -2
- package/es/packages/form-render/src/components/renderer/input.js +3 -3
- package/es/packages/form-render/src/components/renderer/simpleComponent.js +2 -15
- package/es/packages/form-render/src/constants/index.d.ts +2 -1
- package/es/packages/form-render/src/constants/index.js +2 -1
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +3 -1
- package/es/packages/form-render/src/hooks/useFormContext.d.ts +2 -1
- package/es/packages/form-render/src/hooks/useFormContext.js +13 -2
- package/es/packages/form-render/src/utils/index.d.ts +5 -2
- package/es/packages/form-render/src/utils/index.js +16 -2
- package/es/packages/form-render/style/index.css +23 -0
- package/es/packages/index.css +39 -0
- package/es/packages/index.d.ts +4 -1
- package/es/packages/index.js +9 -1
- package/es/packages/scale-view/src/hooks/scaleview-init.js +1 -5
- package/es/packages/scale-view/src/hooks/scaleview-submit.js +1 -6
- package/es/packages/scale-view/src/hooks/scaleview-validate.js +0 -3
- package/es/packages/shortcut-provider/index.d.ts +17 -0
- package/es/packages/shortcut-provider/index.js +13 -0
- package/es/packages/shortcut-provider/src/ShortcutProvider.js +4 -0
- package/es/packages/shortcut-provider/src/ShortcutProvider.vue.d.ts +15 -0
- package/es/packages/shortcut-provider/src/ShortcutProvider.vue_vue_type_script_setup_true_lang.js +32 -0
- package/es/packages/shortcut-provider/src/constants/index.d.ts +7 -0
- package/es/packages/shortcut-provider/src/constants/index.js +8 -0
- package/es/packages/shortcut-provider/src/hooks/index.d.ts +2 -0
- package/es/packages/shortcut-provider/src/hooks/index.js +2 -0
- package/es/packages/shortcut-provider/src/hooks/useShortcutSignature.d.ts +4 -0
- package/es/packages/shortcut-provider/src/hooks/useShortcutSignature.js +12 -0
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.d.ts +30 -0
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +157 -0
- package/es/packages/shortcut-provider/src/types/index.d.ts +30 -0
- package/es/packages/shortcut-provider/src/types/index.js +1 -0
- package/es/packages/shortcut-provider/src/utils/index.d.ts +7 -0
- package/es/packages/shortcut-provider/src/utils/index.js +49 -0
- package/es/packages/shortcut-provider/style/index.css +3 -0
- package/es/packages/shortcut-setter/constant/index.d.ts +4 -0
- package/es/packages/shortcut-setter/constant/index.js +7 -0
- package/es/packages/shortcut-setter/index.d.ts +4258 -0
- package/es/packages/shortcut-setter/index.js +11 -0
- package/es/packages/shortcut-setter/src/ShortcutSetter.js +4 -0
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +4258 -0
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue_vue_type_script_setup_true_lang.js +38 -0
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +4 -0
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +4238 -0
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue_vue_type_script_setup_true_lang.js +125 -0
- package/es/packages/shortcut-setter/style/index.css +8 -0
- package/es/src/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/test.ts +0 -326
package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { defineComponent, computed, ref, openBlock, createElementBlock, createVNode, unref, withModifiers, createElementVNode, withCtx, createTextVNode, toDisplayString } from 'vue';
|
|
2
|
+
import { debounce, isString } from 'lodash-es';
|
|
3
|
+
import { useMessage, NInput, NButton, NPopconfirm } from 'naive-ui';
|
|
4
|
+
import { useShortcuts } from '../../../packages/shortcut-provider';
|
|
5
|
+
import { transformKey2DisplaySignature, getDisplaySignature } from '../../../packages/shortcut-provider/src/utils';
|
|
6
|
+
import { ShortcutInputState } from '../../../packages/shortcut-setter/constant';
|
|
7
|
+
|
|
8
|
+
const _hoisted_1 = { class: "shortcut-setter-item__wrapper" };
|
|
9
|
+
const _hoisted_2 = { class: "shortcut-setter-item__operation" };
|
|
10
|
+
const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u91CD\u7F6E");
|
|
11
|
+
const _hoisted_4 = /* @__PURE__ */ createTextVNode(" \u786E\u8BA4\u91CD\u7F6E\u5FEB\u6377\u952E\u5417 ");
|
|
12
|
+
var script = /* @__PURE__ */ defineComponent({
|
|
13
|
+
__name: "ShortcutSetterItem",
|
|
14
|
+
props: {
|
|
15
|
+
glob: { type: Boolean, required: false },
|
|
16
|
+
value: { type: null, required: true },
|
|
17
|
+
onChange: { type: null, required: true },
|
|
18
|
+
onFocus: { type: null, required: true },
|
|
19
|
+
fieldItem: { type: null, required: true }
|
|
20
|
+
},
|
|
21
|
+
setup(__props) {
|
|
22
|
+
const props = __props;
|
|
23
|
+
const { query, update, updateState } = useShortcuts(props.glob);
|
|
24
|
+
const shortcutItem = computed(() => {
|
|
25
|
+
return query(props.fieldItem.val_key);
|
|
26
|
+
});
|
|
27
|
+
const disabledState = computed(() => {
|
|
28
|
+
var _a;
|
|
29
|
+
return !!((_a = shortcutItem.value) == null ? void 0 : _a.disabled);
|
|
30
|
+
});
|
|
31
|
+
const currentSetShortcut = computed(() => {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
return transformKey2DisplaySignature((_b = (_a = shortcutItem.value) == null ? void 0 : _a.currentKeySignature) != null ? _b : "");
|
|
34
|
+
});
|
|
35
|
+
const state = ref(ShortcutInputState.STATIC);
|
|
36
|
+
const currentEditShortcut = ref("");
|
|
37
|
+
const showContent = computed(() => {
|
|
38
|
+
return state.value === ShortcutInputState.STATIC ? currentSetShortcut.value : currentEditShortcut.value;
|
|
39
|
+
});
|
|
40
|
+
function onInputFocus() {
|
|
41
|
+
state.value = ShortcutInputState.EDIT;
|
|
42
|
+
}
|
|
43
|
+
const inputRef = ref();
|
|
44
|
+
function onInputBlur() {
|
|
45
|
+
var _a;
|
|
46
|
+
state.value = ShortcutInputState.STATIC;
|
|
47
|
+
currentEditShortcut.value = "";
|
|
48
|
+
(_a = inputRef.value) == null ? void 0 : _a.blur();
|
|
49
|
+
}
|
|
50
|
+
const onInputKeyDown = debounce((event) => {
|
|
51
|
+
currentEditShortcut.value = getDisplaySignature(event);
|
|
52
|
+
}, 200, { leading: true, trailing: false });
|
|
53
|
+
const $message = useMessage();
|
|
54
|
+
function updateDecorator(fn, afterUpdate) {
|
|
55
|
+
try {
|
|
56
|
+
fn();
|
|
57
|
+
} catch (e) {
|
|
58
|
+
isString(e) && $message.error(e);
|
|
59
|
+
currentEditShortcut.value = "";
|
|
60
|
+
} finally {
|
|
61
|
+
afterUpdate == null ? void 0 : afterUpdate();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const onInputKeyUp = debounce((event) => {
|
|
65
|
+
updateDecorator(() => update(props.fieldItem.val_key, event), () => event.target.blur());
|
|
66
|
+
}, 200, { leading: true, trailing: false });
|
|
67
|
+
function onStop() {
|
|
68
|
+
if (!shortcutItem.value)
|
|
69
|
+
return;
|
|
70
|
+
updateDecorator(() => updateState(props.fieldItem.val_key, !disabledState.value), onInputBlur);
|
|
71
|
+
}
|
|
72
|
+
function onReset() {
|
|
73
|
+
if (!shortcutItem.value)
|
|
74
|
+
return;
|
|
75
|
+
updateDecorator(() => update(props.fieldItem.val_key, shortcutItem.value.defaultShortcut), onInputBlur);
|
|
76
|
+
}
|
|
77
|
+
return (_ctx, _cache) => {
|
|
78
|
+
return openBlock(), createElementBlock("section", _hoisted_1, [
|
|
79
|
+
createVNode(unref(NInput), {
|
|
80
|
+
ref_key: "inputRef",
|
|
81
|
+
ref: inputRef,
|
|
82
|
+
disabled: unref(disabledState),
|
|
83
|
+
value: unref(showContent),
|
|
84
|
+
onFocus: onInputFocus,
|
|
85
|
+
onBlur: onInputBlur,
|
|
86
|
+
onKeydown: withModifiers(unref(onInputKeyDown), ["prevent", "stop"]),
|
|
87
|
+
onKeyup: withModifiers(unref(onInputKeyUp), ["prevent", "stop"])
|
|
88
|
+
}, null, 8, ["disabled", "value", "onKeydown", "onKeyup"]),
|
|
89
|
+
createElementVNode("section", _hoisted_2, [
|
|
90
|
+
createVNode(unref(NButton), {
|
|
91
|
+
text: "",
|
|
92
|
+
onClick: onStop,
|
|
93
|
+
type: unref(disabledState) ? "info" : "warning"
|
|
94
|
+
}, {
|
|
95
|
+
default: withCtx(() => [
|
|
96
|
+
createTextVNode(toDisplayString(unref(disabledState) ? "\u542F\u7528" : "\u7981\u7528"), 1)
|
|
97
|
+
]),
|
|
98
|
+
_: 1
|
|
99
|
+
}, 8, ["type"]),
|
|
100
|
+
createVNode(unref(NPopconfirm), { onPositiveClick: onReset }, {
|
|
101
|
+
trigger: withCtx(() => [
|
|
102
|
+
createVNode(unref(NButton), {
|
|
103
|
+
disabled: unref(disabledState),
|
|
104
|
+
text: "",
|
|
105
|
+
onClick: onInputBlur,
|
|
106
|
+
type: "info"
|
|
107
|
+
}, {
|
|
108
|
+
default: withCtx(() => [
|
|
109
|
+
_hoisted_3
|
|
110
|
+
]),
|
|
111
|
+
_: 1
|
|
112
|
+
}, 8, ["disabled"])
|
|
113
|
+
]),
|
|
114
|
+
default: withCtx(() => [
|
|
115
|
+
_hoisted_4
|
|
116
|
+
]),
|
|
117
|
+
_: 1
|
|
118
|
+
})
|
|
119
|
+
])
|
|
120
|
+
]);
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
export { script as default };
|
package/es/src/types/index.d.ts
CHANGED
|
@@ -7,3 +7,4 @@ export declare type Func<T extends Array<any> = any[], P = any> = (...args: T) =
|
|
|
7
7
|
export declare type WithNull<T> = T | null;
|
|
8
8
|
export declare type WithUndefined<T> = T | undefined;
|
|
9
9
|
export declare type ArrayAble<T> = T | T[];
|
|
10
|
+
export declare type MapValue<T> = T extends Map<any, infer P> ? P : any;
|
package/package.json
CHANGED
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
|
-
<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
|
-
});
|