@fecp/designer 5.5.100 → 5.5.102
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/designer/package.json.mjs +1 -1
- package/es/designer/src/packages/dialog/useDialogDialog.mjs +1 -1
- package/es/designer/src/packages/dialogGlobal/useDialogGlobalDialog.mjs +1 -1
- package/es/designer/src/packages/form/property/widgets.vue.mjs +2 -2
- package/es/designer.css +436 -125
- package/es/packages/mobile/index.mjs +4 -0
- package/es/packages/mobile/src/components/all.mjs +4 -0
- package/es/packages/mobile/src/components/custom/appDetail/AppDetail.vue.mjs +69 -9
- package/es/packages/mobile/src/components/custom/approvalBar/ApprovalBar.vue.mjs +191 -0
- package/es/packages/mobile/src/components/custom/approvalBar/index.mjs +10 -0
- package/es/packages/mobile/src/components/custom/approvalList/ApprovalList.vue.mjs +391 -0
- package/es/packages/mobile/src/components/custom/approvalList/index.mjs +10 -0
- package/es/packages/mobile/src/components/dataDisplay/cardList/CardList.vue.mjs +2 -18
- package/es/packages/mobile/src/components/dataDisplay/table/Table.vue.mjs +43 -11
- package/es/packages/mobile/src/components/form/field/Field.vue.mjs +38 -26
- package/es/packages/mobile/src/components/form/fieldArea/FieldArea.vue.mjs +4 -2
- package/es/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.mjs +1 -1
- package/es/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.mjs +1 -1
- package/es/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.mjs +1 -1
- package/es/packages/mobile/src/components/form/fieldDateTimePicker/FieldDateTimePicker.vue.mjs +1 -1
- package/es/packages/mobile/src/components/form/fieldIndustry/FieldIndustry.vue.mjs +38 -27
- package/es/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.mjs +58 -41
- package/es/packages/mobile/src/components/form/fieldTimePicker/FieldTimePicker.vue.mjs +1 -1
- package/es/packages/mobile/src/components/navigation/tabs/Tabs.vue.mjs +34 -5
- package/es/packages/mobile/src/composables/usePageEvents.mjs +80 -0
- package/es/packages/mobile/src/index.vue.mjs +11 -21
- package/es/packages/mobile/src/page.vue.mjs +152 -12
- package/es/packages/mobile/src/utils/common.mjs +15 -0
- package/es/packages/mobile/src/utils/datasource.mjs +12 -1
- package/es/packages/mobile/src/utils/eventFlow/actionHandlers.mjs +852 -0
- package/es/packages/mobile/src/utils/eventFlow/eventFlowHandler.mjs +94 -0
- package/es/packages/mobile/src/utils/eventFlowParser.mjs +396 -0
- package/es/packages/mobile/src/utils/formatterUtil.mjs +1 -0
- package/es/packages/mobile/src/utils/parseFilterConfig.mjs +98 -0
- package/es/packages/vue/src/components/forms/form/Form.vue.mjs +1 -1
- package/es/packages/vue/src/components/forms/subTable/SubTable.vue.mjs +8 -7
- package/es/packages/vue/src/components/table/Table.vue.mjs +11 -1
- package/lib/designer/package.json.js +1 -1
- package/lib/designer/src/packages/dialog/useDialogDialog.js +1 -1
- package/lib/designer/src/packages/dialogGlobal/useDialogGlobalDialog.js +1 -1
- package/lib/designer/src/packages/form/property/widgets.vue.js +2 -2
- package/lib/designer.css +436 -125
- package/lib/packages/mobile/index.js +6 -2
- package/lib/packages/mobile/src/components/all.js +4 -0
- package/lib/packages/mobile/src/components/custom/appDetail/AppDetail.vue.js +68 -8
- package/lib/packages/mobile/src/components/custom/approvalBar/ApprovalBar.vue.js +191 -0
- package/lib/packages/mobile/src/components/custom/approvalBar/index.js +10 -0
- package/lib/packages/mobile/src/components/custom/approvalList/ApprovalList.vue.js +391 -0
- package/lib/packages/mobile/src/components/custom/approvalList/index.js +10 -0
- package/lib/packages/mobile/src/components/dataDisplay/cardList/CardList.vue.js +2 -18
- package/lib/packages/mobile/src/components/dataDisplay/table/Table.vue.js +43 -11
- package/lib/packages/mobile/src/components/form/field/Field.vue.js +37 -25
- package/lib/packages/mobile/src/components/form/fieldArea/FieldArea.vue.js +4 -2
- package/lib/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.js +1 -1
- package/lib/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.js +1 -1
- package/lib/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.js +1 -1
- package/lib/packages/mobile/src/components/form/fieldDateTimePicker/FieldDateTimePicker.vue.js +1 -1
- package/lib/packages/mobile/src/components/form/fieldIndustry/FieldIndustry.vue.js +37 -26
- package/lib/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.js +57 -40
- package/lib/packages/mobile/src/components/form/fieldTimePicker/FieldTimePicker.vue.js +1 -1
- package/lib/packages/mobile/src/components/navigation/tabs/Tabs.vue.js +33 -4
- package/lib/packages/mobile/src/composables/usePageEvents.js +80 -0
- package/lib/packages/mobile/src/index.vue.js +11 -21
- package/lib/packages/mobile/src/page.vue.js +151 -11
- package/lib/packages/mobile/src/utils/common.js +15 -0
- package/lib/packages/mobile/src/utils/datasource.js +14 -3
- package/lib/packages/mobile/src/utils/eventFlow/actionHandlers.js +852 -0
- package/lib/packages/mobile/src/utils/eventFlow/eventFlowHandler.js +94 -0
- package/lib/packages/mobile/src/utils/eventFlowParser.js +396 -0
- package/lib/packages/mobile/src/utils/formatterUtil.js +1 -0
- package/lib/packages/mobile/src/utils/parseFilterConfig.js +98 -0
- package/lib/packages/vue/src/components/forms/form/Form.vue.js +1 -1
- package/lib/packages/vue/src/components/forms/subTable/SubTable.vue.js +7 -6
- package/lib/packages/vue/src/components/table/Table.vue.js +11 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
|
-
import {
|
|
6
|
+
import { getCurrentInstance, computed, ref, watch, createElementBlock, openBlock, Fragment, createVNode, withDirectives, renderSlot, mergeProps, unref, isRef, createSlots, renderList, withCtx, createElementVNode, toDisplayString, createTextVNode, vModelText } from "vue";
|
|
7
7
|
import { getUnit, textFormatter, textFormatter4Input, reverseTextFormatter } from "../../../utils/formatterUtil.mjs";
|
|
8
8
|
import { useCursor } from "../../../utils/use-cursor.mjs";
|
|
9
9
|
/* empty css */
|
|
@@ -37,42 +37,44 @@ const _sfc_main = {
|
|
|
37
37
|
showUnit: {
|
|
38
38
|
type: Boolean,
|
|
39
39
|
default: true
|
|
40
|
-
}
|
|
40
|
+
},
|
|
41
|
+
maxlength: {
|
|
42
|
+
type: Number,
|
|
43
|
+
default: 0
|
|
44
|
+
},
|
|
45
|
+
formData: Object
|
|
41
46
|
},
|
|
42
47
|
emits: ["openPicker", "update:modelValue"],
|
|
43
48
|
setup(__props, { emit: __emit }) {
|
|
44
49
|
const props = __props;
|
|
50
|
+
const instance = getCurrentInstance();
|
|
51
|
+
const ctx = instance.proxy;
|
|
52
|
+
const realMaxLength = computed(() => {
|
|
53
|
+
return Math.floor(props.maxLength / (ctx.$dbFieldLengthRatio || 1)) || "-";
|
|
54
|
+
});
|
|
45
55
|
const unit = ref("");
|
|
46
56
|
const fieldInputRef = ref();
|
|
47
57
|
const [recordCursor, setCursor] = useCursor();
|
|
48
58
|
const emit = __emit;
|
|
49
59
|
const textValue = ref("");
|
|
50
60
|
const compValue = computed({
|
|
51
|
-
get: () =>
|
|
52
|
-
if (!props.fieldType || props.fieldType == "text") {
|
|
53
|
-
unit.value = getUnit(props.dataFormatter);
|
|
54
|
-
if (props.readonly) {
|
|
55
|
-
textValue.value = textFormatter(props.modelValue, props.dataFormatter);
|
|
56
|
-
} else {
|
|
57
|
-
textValue.value = textFormatter4Input(
|
|
58
|
-
props.modelValue,
|
|
59
|
-
props.dataFormatter
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
} else {
|
|
63
|
-
textValue.value = props.modelValue;
|
|
64
|
-
}
|
|
65
|
-
return props.modelValue;
|
|
66
|
-
},
|
|
61
|
+
get: () => props.modelValue,
|
|
67
62
|
set: (val) => {
|
|
68
63
|
emit("update:modelValue", val);
|
|
69
64
|
}
|
|
70
65
|
});
|
|
71
|
-
watch(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
watch(
|
|
67
|
+
() => props.modelValue,
|
|
68
|
+
(newVal) => {
|
|
69
|
+
unit.value = getUnit(props.dataFormatter);
|
|
70
|
+
if (!props.fieldType || props.fieldType === "text") {
|
|
71
|
+
textValue.value = textFormatter(newVal, props.dataFormatter);
|
|
72
|
+
} else {
|
|
73
|
+
textValue.value = newVal;
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{ immediate: true, flush: "post" }
|
|
77
|
+
);
|
|
76
78
|
const compClickable = computed(() => {
|
|
77
79
|
if (props.disabled || props.readonly) {
|
|
78
80
|
return false;
|
|
@@ -120,8 +122,10 @@ const _sfc_main = {
|
|
|
120
122
|
const _component_van_field = Field;
|
|
121
123
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
122
124
|
createVNode(_component_van_field, mergeProps(_ctx.$attrs, {
|
|
125
|
+
type: _ctx.$attrs.type == "number" ? "text" : _ctx.$attrs.type,
|
|
123
126
|
modelValue: unref(textValue),
|
|
124
127
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(textValue) ? textValue.value = $event : null),
|
|
128
|
+
maxlength: unref(realMaxLength),
|
|
125
129
|
disabled: __props.disabled,
|
|
126
130
|
readonly: __props.readonly,
|
|
127
131
|
clearable: "",
|
|
@@ -132,7 +136,8 @@ const _sfc_main = {
|
|
|
132
136
|
ref: fieldInputRef,
|
|
133
137
|
onInput: handleInput,
|
|
134
138
|
onCompositionstart: handleCompositionStart,
|
|
135
|
-
onCompositionend: handleCompositionEnd
|
|
139
|
+
onCompositionend: handleCompositionEnd,
|
|
140
|
+
"input-align": "right"
|
|
136
141
|
}), createSlots({ _: 2 }, [
|
|
137
142
|
renderList(_ctx.$slots, (item, key) => {
|
|
138
143
|
return {
|
|
@@ -142,14 +147,21 @@ const _sfc_main = {
|
|
|
142
147
|
])
|
|
143
148
|
};
|
|
144
149
|
}),
|
|
150
|
+
__props.disabled ? {
|
|
151
|
+
name: "input",
|
|
152
|
+
fn: withCtx(() => [
|
|
153
|
+
createElementVNode("div", null, toDisplayString(unref(textValue)), 1)
|
|
154
|
+
]),
|
|
155
|
+
key: "0"
|
|
156
|
+
} : void 0,
|
|
145
157
|
__props.showUnit && unref(unit) ? {
|
|
146
158
|
name: "button",
|
|
147
159
|
fn: withCtx(() => [
|
|
148
160
|
createTextVNode(toDisplayString(unref(unit)), 1)
|
|
149
161
|
]),
|
|
150
|
-
key: "
|
|
162
|
+
key: "1"
|
|
151
163
|
} : void 0
|
|
152
|
-
]), 1040, ["modelValue", "disabled", "readonly", "clickable"]),
|
|
164
|
+
]), 1040, ["type", "modelValue", "maxlength", "disabled", "readonly", "clickable"]),
|
|
153
165
|
withDirectives(createElementVNode("input", {
|
|
154
166
|
type: "hidden",
|
|
155
167
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(compValue) ? compValue.value = $event : null)
|
|
@@ -137,7 +137,7 @@ const _sfc_main = {
|
|
|
137
137
|
return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
|
|
138
138
|
modelValue: unref(fieldTextValue),
|
|
139
139
|
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
140
|
-
isLink: __props.readonly ? false : true,
|
|
140
|
+
isLink: __props.readonly || __props.disabled ? false : true,
|
|
141
141
|
readonly: "",
|
|
142
142
|
disabled: __props.disabled,
|
|
143
143
|
onOpenPicker: _cache[5] || (_cache[5] = () => {
|
|
@@ -158,11 +158,13 @@ const _sfc_main = {
|
|
|
158
158
|
createVNode(_component_van_cascader, mergeProps(_ctx.$attrs, {
|
|
159
159
|
modelValue: unref(pickerValue),
|
|
160
160
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(pickerValue) ? pickerValue.value = $event : null),
|
|
161
|
+
title: `${_ctx.$attrs.label}`,
|
|
161
162
|
options: unref(finalOptions),
|
|
163
|
+
"field-names": __props.treeOptionsFieldNames,
|
|
162
164
|
placeholder: "请选择",
|
|
163
165
|
onFinish,
|
|
164
166
|
onClose: _cache[2] || (_cache[2] = ($event) => showPicker.value = false)
|
|
165
|
-
}), null, 16, ["modelValue", "options"])
|
|
167
|
+
}), null, 16, ["modelValue", "title", "options", "field-names"])
|
|
166
168
|
]),
|
|
167
169
|
_: 1
|
|
168
170
|
}, 8, ["show"])
|
package/es/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.mjs
CHANGED
|
@@ -137,7 +137,7 @@ const _sfc_main = {
|
|
|
137
137
|
return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
|
|
138
138
|
modelValue: unref(fieldTextValue),
|
|
139
139
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
140
|
-
isLink: __props.readonly ? false : true,
|
|
140
|
+
isLink: __props.readonly || __props.disabled ? false : true,
|
|
141
141
|
readonly: "",
|
|
142
142
|
disabled: __props.disabled,
|
|
143
143
|
onOpenPicker: _cache[3] || (_cache[3] = () => {
|
package/es/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.mjs
CHANGED
|
@@ -132,7 +132,7 @@ const _sfc_main = {
|
|
|
132
132
|
return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
|
|
133
133
|
modelValue: unref(fieldTextValue),
|
|
134
134
|
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
135
|
-
isLink: __props.readonly ? false : true,
|
|
135
|
+
isLink: __props.readonly || __props.disabled ? false : true,
|
|
136
136
|
readonly: "",
|
|
137
137
|
disabled: __props.disabled,
|
|
138
138
|
onOpenPicker: _cache[5] || (_cache[5] = () => {
|
|
@@ -123,7 +123,7 @@ const _sfc_main = {
|
|
|
123
123
|
return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
|
|
124
124
|
modelValue: unref(fieldTextValue),
|
|
125
125
|
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
126
|
-
isLink: __props.readonly ? false : true,
|
|
126
|
+
isLink: __props.readonly || __props.disabled ? false : true,
|
|
127
127
|
readonly: "",
|
|
128
128
|
disabled: __props.disabled,
|
|
129
129
|
onOpenPicker: _cache[5] || (_cache[5] = () => {
|
package/es/packages/mobile/src/components/form/fieldDateTimePicker/FieldDateTimePicker.vue.mjs
CHANGED
|
@@ -122,7 +122,7 @@ const _sfc_main = {
|
|
|
122
122
|
return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
|
|
123
123
|
modelValue: unref(fieldTextValue),
|
|
124
124
|
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
125
|
-
isLink: __props.readonly ? false : true,
|
|
125
|
+
isLink: __props.readonly || __props.disabled ? false : true,
|
|
126
126
|
readonly: "",
|
|
127
127
|
disabled: __props.disabled,
|
|
128
128
|
onOpenPicker: _cache[6] || (_cache[6] = () => {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
/* empty css */
|
|
10
10
|
/* empty css */
|
|
11
11
|
/* empty css */
|
|
12
|
-
import { ref, computed,
|
|
12
|
+
import { ref, computed, createBlock, openBlock, unref, mergeProps, isRef, createSlots, withCtx, createVNode, withModifiers } from "vue";
|
|
13
13
|
import { MobileField } from "../field/index.mjs";
|
|
14
14
|
import { a as appExports } from "../../../../../../_virtual/app.mjs";
|
|
15
15
|
import { Popup } from "../../../../node_modules/vant/es/popup/index.mjs";
|
|
@@ -78,21 +78,24 @@ const _sfc_main = {
|
|
|
78
78
|
}
|
|
79
79
|
return data.map((node) => processNode(node, 0));
|
|
80
80
|
}
|
|
81
|
-
const fieldTextValue = ref("");
|
|
82
81
|
const showPicker = ref(false);
|
|
83
82
|
const emit = __emit;
|
|
84
83
|
const pickerValue = computed(() => {
|
|
85
|
-
const value = props.modelValue
|
|
86
|
-
|
|
84
|
+
const value = props.modelValue;
|
|
85
|
+
let val = value[value.length - 1];
|
|
86
|
+
if (val.length > 1) {
|
|
87
|
+
return val.substring(1);
|
|
88
|
+
}
|
|
89
|
+
return val;
|
|
87
90
|
});
|
|
88
91
|
function getDisplayValue(options, fieldNames, modelValue) {
|
|
89
|
-
const {
|
|
90
|
-
const values = modelValue
|
|
92
|
+
const { text, value, children } = fieldNames;
|
|
93
|
+
const values = modelValue;
|
|
91
94
|
const displayValues = [];
|
|
92
95
|
function findValueInOptions(currentOptions, targetValue) {
|
|
93
96
|
for (const option of currentOptions) {
|
|
94
97
|
if (option[value] === targetValue) {
|
|
95
|
-
return option[
|
|
98
|
+
return option[text];
|
|
96
99
|
}
|
|
97
100
|
if (option[children] && option[children].length > 0) {
|
|
98
101
|
const result = findValueInOptions(option[children], targetValue);
|
|
@@ -103,7 +106,11 @@ const _sfc_main = {
|
|
|
103
106
|
}
|
|
104
107
|
return null;
|
|
105
108
|
}
|
|
106
|
-
for (
|
|
109
|
+
for (let i = 0; i < values.length; i++) {
|
|
110
|
+
let val = values[i];
|
|
111
|
+
if (i > 0) {
|
|
112
|
+
val = val.substring(1);
|
|
113
|
+
}
|
|
107
114
|
const displayValue = findValueInOptions(options, val);
|
|
108
115
|
if (displayValue) {
|
|
109
116
|
displayValues.push(displayValue);
|
|
@@ -111,24 +118,26 @@ const _sfc_main = {
|
|
|
111
118
|
}
|
|
112
119
|
return displayValues.join("/");
|
|
113
120
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
fieldTextValue.value = getDisplayValue(
|
|
122
|
-
options,
|
|
123
|
-
props.treeOptionsFieldNames,
|
|
124
|
-
value
|
|
125
|
-
);
|
|
126
|
-
},
|
|
127
|
-
{ immediate: true }
|
|
128
|
-
);
|
|
121
|
+
const fieldTextValue = computed(() => {
|
|
122
|
+
return getDisplayValue(
|
|
123
|
+
finalOptions.value,
|
|
124
|
+
props.treeOptionsFieldNames,
|
|
125
|
+
props.modelValue
|
|
126
|
+
);
|
|
127
|
+
});
|
|
129
128
|
const onFinish = ({ selectedOptions }) => {
|
|
130
|
-
const value = selectedOptions.map(
|
|
131
|
-
|
|
129
|
+
const value = selectedOptions.map(
|
|
130
|
+
(option) => option[props.treeOptionsFieldNames.value]
|
|
131
|
+
);
|
|
132
|
+
const realValue = [];
|
|
133
|
+
for (let i = 0; i < value.length; i++) {
|
|
134
|
+
if (i > 0) {
|
|
135
|
+
realValue.push(value[0] + value[i]);
|
|
136
|
+
} else {
|
|
137
|
+
realValue.push(value[i]);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
emit("update:modelValue", realValue);
|
|
132
141
|
showPicker.value = false;
|
|
133
142
|
};
|
|
134
143
|
return (_ctx, _cache) => {
|
|
@@ -138,7 +147,7 @@ const _sfc_main = {
|
|
|
138
147
|
return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
|
|
139
148
|
modelValue: unref(fieldTextValue),
|
|
140
149
|
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
141
|
-
isLink: __props.readonly ? false : true,
|
|
150
|
+
isLink: __props.readonly || __props.disabled ? false : true,
|
|
142
151
|
readonly: "",
|
|
143
152
|
disabled: __props.disabled,
|
|
144
153
|
onOpenPicker: _cache[5] || (_cache[5] = () => {
|
|
@@ -159,11 +168,13 @@ const _sfc_main = {
|
|
|
159
168
|
createVNode(_component_van_cascader, mergeProps(_ctx.$attrs, {
|
|
160
169
|
modelValue: unref(pickerValue),
|
|
161
170
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(pickerValue) ? pickerValue.value = $event : null),
|
|
171
|
+
title: `${_ctx.$attrs.label}`,
|
|
162
172
|
options: unref(finalOptions),
|
|
173
|
+
"field-names": __props.treeOptionsFieldNames,
|
|
163
174
|
placeholder: "请选择",
|
|
164
175
|
onFinish,
|
|
165
176
|
onClose: _cache[2] || (_cache[2] = ($event) => showPicker.value = false)
|
|
166
|
-
}), null, 16, ["modelValue", "options"])
|
|
177
|
+
}), null, 16, ["modelValue", "title", "options", "field-names"])
|
|
167
178
|
]),
|
|
168
179
|
_: 1
|
|
169
180
|
}, 8, ["show"])
|
|
@@ -11,35 +11,16 @@
|
|
|
11
11
|
/* empty css */
|
|
12
12
|
/* empty css */
|
|
13
13
|
/* empty css */
|
|
14
|
-
import { useAttrs, ref,
|
|
14
|
+
import { getCurrentInstance, useAttrs, ref, watch, computed, createBlock, openBlock, unref, mergeProps, isRef, createSlots, withCtx, createVNode, withModifiers } from "vue";
|
|
15
15
|
import { MobileField } from "../field/index.mjs";
|
|
16
|
-
import "../../../utils/optionUtil.mjs";
|
|
16
|
+
import { getOptions } from "../../../utils/optionUtil.mjs";
|
|
17
|
+
import { cloneDeep } from "../../../utils/common.mjs";
|
|
17
18
|
import { Picker } from "../../../../node_modules/vant/es/picker/index.mjs";
|
|
18
19
|
import { Popup } from "../../../../node_modules/vant/es/popup/index.mjs";
|
|
19
20
|
import { Icon } from "../../../../node_modules/vant/es/icon/index.mjs";
|
|
20
21
|
const _sfc_main = {
|
|
21
22
|
__name: "FieldPicker",
|
|
22
23
|
props: {
|
|
23
|
-
// optionType: {
|
|
24
|
-
// type: String,
|
|
25
|
-
// default: "static",
|
|
26
|
-
// },
|
|
27
|
-
// dicKey: {
|
|
28
|
-
// type: String,
|
|
29
|
-
// default: "",
|
|
30
|
-
// },
|
|
31
|
-
// dicList: {
|
|
32
|
-
// type: Array,
|
|
33
|
-
// default: [],
|
|
34
|
-
// },
|
|
35
|
-
// dataSource: {
|
|
36
|
-
// type: String,
|
|
37
|
-
// default: "",
|
|
38
|
-
// },
|
|
39
|
-
// dataSourceParams: {
|
|
40
|
-
// type: Object,
|
|
41
|
-
// default: {},
|
|
42
|
-
// },
|
|
43
24
|
pickerOptions: {
|
|
44
25
|
type: Array,
|
|
45
26
|
default: []
|
|
@@ -63,39 +44,69 @@ const _sfc_main = {
|
|
|
63
44
|
type: Boolean,
|
|
64
45
|
default: false
|
|
65
46
|
},
|
|
66
|
-
"is-link": false
|
|
47
|
+
"is-link": false,
|
|
48
|
+
optionConfig: {
|
|
49
|
+
type: Object,
|
|
50
|
+
default: () => ({})
|
|
51
|
+
},
|
|
52
|
+
dataSources: {
|
|
53
|
+
type: Array,
|
|
54
|
+
default: () => []
|
|
55
|
+
},
|
|
56
|
+
formData: {
|
|
57
|
+
type: Object,
|
|
58
|
+
default: () => {
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
fields: {
|
|
62
|
+
type: Array,
|
|
63
|
+
default: () => []
|
|
64
|
+
}
|
|
67
65
|
},
|
|
68
66
|
emits: ["update:modelValue"],
|
|
69
67
|
setup(__props, { emit: __emit }) {
|
|
68
|
+
const currentInstance = getCurrentInstance();
|
|
69
|
+
const ctx = currentInstance.proxy;
|
|
70
70
|
const props = __props;
|
|
71
71
|
useAttrs();
|
|
72
72
|
const finalOptions = ref([]);
|
|
73
|
-
|
|
73
|
+
watch(
|
|
74
|
+
() => cloneDeep(props.optionConfig),
|
|
75
|
+
(val) => {
|
|
76
|
+
getOptions({
|
|
77
|
+
ctx,
|
|
78
|
+
dataSources: props.dataSources,
|
|
79
|
+
formData: props.formData,
|
|
80
|
+
fields: props.fields,
|
|
81
|
+
...props.optionConfig
|
|
82
|
+
}).then((data) => {
|
|
83
|
+
finalOptions.value = data;
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
deep: true,
|
|
88
|
+
immediate: true
|
|
89
|
+
}
|
|
90
|
+
);
|
|
74
91
|
const showPicker = ref(false);
|
|
75
92
|
const emit = __emit;
|
|
76
93
|
const pickerValue = computed({
|
|
77
94
|
get: () => {
|
|
78
95
|
const value = props.modelValue;
|
|
79
|
-
return
|
|
96
|
+
return value.split(",");
|
|
80
97
|
},
|
|
81
98
|
set: (val) => {
|
|
82
|
-
emit("update:modelValue", val);
|
|
99
|
+
emit("update:modelValue", val.join(","));
|
|
83
100
|
}
|
|
84
101
|
});
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
const optionItem = options.find((item) => item.value == value);
|
|
93
|
-
fieldTextValue.value = optionItem == null ? void 0 : optionItem.text;
|
|
94
|
-
},
|
|
95
|
-
{ immediate: true }
|
|
96
|
-
);
|
|
102
|
+
const fieldTextValue = computed(() => {
|
|
103
|
+
const selectedOption = finalOptions.value.find(
|
|
104
|
+
(option) => option.value == pickerValue.value.join(",")
|
|
105
|
+
);
|
|
106
|
+
return selectedOption ? selectedOption.label : "";
|
|
107
|
+
});
|
|
97
108
|
const onConfirm = ({ selectedValues, selectedOptions }) => {
|
|
98
|
-
pickerValue.value = selectedValues
|
|
109
|
+
pickerValue.value = selectedValues;
|
|
99
110
|
showPicker.value = false;
|
|
100
111
|
};
|
|
101
112
|
return (_ctx, _cache) => {
|
|
@@ -105,7 +116,7 @@ const _sfc_main = {
|
|
|
105
116
|
return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
|
|
106
117
|
modelValue: unref(fieldTextValue),
|
|
107
118
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
108
|
-
isLink: __props.readonly ? false : true,
|
|
119
|
+
isLink: __props.readonly || __props.disabled ? false : true,
|
|
109
120
|
readonly: "",
|
|
110
121
|
disabled: __props.disabled,
|
|
111
122
|
onOpenPicker: _cache[4] || (_cache[4] = () => {
|
|
@@ -124,12 +135,18 @@ const _sfc_main = {
|
|
|
124
135
|
}, {
|
|
125
136
|
default: withCtx(() => [
|
|
126
137
|
createVNode(_component_van_picker, mergeProps(_ctx.$attrs, {
|
|
138
|
+
title: `${_ctx.$attrs.label}`,
|
|
127
139
|
columns: unref(finalOptions),
|
|
140
|
+
"columns-field-names": {
|
|
141
|
+
text: "label",
|
|
142
|
+
value: "value",
|
|
143
|
+
children: "children"
|
|
144
|
+
},
|
|
128
145
|
"model-value": unref(pickerValue),
|
|
129
146
|
readonly: false,
|
|
130
147
|
onConfirm,
|
|
131
148
|
onCancel: _cache[1] || (_cache[1] = ($event) => showPicker.value = false)
|
|
132
|
-
}), null, 16, ["columns", "model-value"])
|
|
149
|
+
}), null, 16, ["title", "columns", "model-value"])
|
|
133
150
|
]),
|
|
134
151
|
_: 1
|
|
135
152
|
}, 8, ["show"])
|
|
@@ -125,7 +125,7 @@ const _sfc_main = {
|
|
|
125
125
|
return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
|
|
126
126
|
modelValue: unref(fieldTextValue),
|
|
127
127
|
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
128
|
-
isLink: __props.readonly ? false : true,
|
|
128
|
+
isLink: __props.readonly || __props.disabled ? false : true,
|
|
129
129
|
readonly: "",
|
|
130
130
|
disabled: __props.disabled,
|
|
131
131
|
onOpenPicker: _cache[5] || (_cache[5] = () => {
|
|
@@ -5,14 +5,21 @@
|
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
|
-
import { computed, createElementBlock, openBlock, normalizeStyle, unref, createVNode, isRef, withCtx, Fragment, renderList, createBlock, mergeProps,
|
|
8
|
+
import { inject, computed, createElementBlock, openBlock, normalizeStyle, unref, createVNode, isRef, withCtx, Fragment, renderList, createBlock, mergeProps, createElementVNode, createCommentVNode } from "vue";
|
|
9
|
+
import { findPageById } from "../../../utils/common.mjs";
|
|
10
|
+
import MobilePage from "../../../page.vue.mjs";
|
|
9
11
|
/* empty css */
|
|
10
12
|
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
11
13
|
import { Tabs } from "../../../../node_modules/vant/es/tabs/index.mjs";
|
|
12
14
|
import { Tab } from "../../../../node_modules/vant/es/tab/index.mjs";
|
|
15
|
+
const _hoisted_1 = { class: "fec-tab-content" };
|
|
13
16
|
const _sfc_main = {
|
|
14
17
|
__name: "Tabs",
|
|
15
18
|
props: {
|
|
19
|
+
params: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: {}
|
|
22
|
+
},
|
|
16
23
|
modelValue: {
|
|
17
24
|
type: String,
|
|
18
25
|
default: ""
|
|
@@ -36,6 +43,7 @@ const _sfc_main = {
|
|
|
36
43
|
setup(__props, { emit: __emit }) {
|
|
37
44
|
const props = __props;
|
|
38
45
|
const emit = __emit;
|
|
46
|
+
const pageList = inject("pageList");
|
|
39
47
|
const activeName = computed({
|
|
40
48
|
get: () => {
|
|
41
49
|
return props.modelValue;
|
|
@@ -51,6 +59,19 @@ const _sfc_main = {
|
|
|
51
59
|
return props.height + "px";
|
|
52
60
|
}
|
|
53
61
|
});
|
|
62
|
+
const pageCache = computed(() => {
|
|
63
|
+
const cache = {};
|
|
64
|
+
props.options.forEach((item) => {
|
|
65
|
+
if (item.pageId) {
|
|
66
|
+
cache[item.pageId] = findPageById(pageList.value, item.pageId);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
console.log("🚀 ~ cache:", cache);
|
|
70
|
+
return cache;
|
|
71
|
+
});
|
|
72
|
+
const getPage = (pageId) => {
|
|
73
|
+
return pageCache.value[pageId] || null;
|
|
74
|
+
};
|
|
54
75
|
return (_ctx, _cache) => {
|
|
55
76
|
const _component_van_tab = Tab;
|
|
56
77
|
const _component_van_tabs = Tabs;
|
|
@@ -62,19 +83,27 @@ const _sfc_main = {
|
|
|
62
83
|
sticky: "",
|
|
63
84
|
class: "fec-tabs",
|
|
64
85
|
active: unref(activeName),
|
|
65
|
-
"onUpdate:active": _cache[0] || (_cache[0] = ($event) => isRef(activeName) ? activeName.value = $event : null)
|
|
86
|
+
"onUpdate:active": _cache[0] || (_cache[0] = ($event) => isRef(activeName) ? activeName.value = $event : null),
|
|
87
|
+
"lazy-render": ""
|
|
66
88
|
}, {
|
|
67
89
|
default: withCtx(() => [
|
|
68
90
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item) => {
|
|
69
91
|
return openBlock(), createBlock(_component_van_tab, mergeProps({ ref_for: true }, item, {
|
|
92
|
+
name: item.id,
|
|
70
93
|
replace: "",
|
|
71
94
|
"show-zero-badge": false
|
|
72
95
|
}), {
|
|
73
96
|
default: withCtx(() => [
|
|
74
|
-
|
|
97
|
+
createElementVNode("div", _hoisted_1, [
|
|
98
|
+
item.pageId && getPage(item.pageId) ? (openBlock(), createBlock(MobilePage, {
|
|
99
|
+
key: 0,
|
|
100
|
+
parentPage: getPage(item.pageId),
|
|
101
|
+
params: __props.params
|
|
102
|
+
}, null, 8, ["parentPage", "params"])) : createCommentVNode("", true)
|
|
103
|
+
])
|
|
75
104
|
]),
|
|
76
105
|
_: 2
|
|
77
|
-
}, 1040);
|
|
106
|
+
}, 1040, ["name"]);
|
|
78
107
|
}), 256))
|
|
79
108
|
]),
|
|
80
109
|
_: 1
|
|
@@ -83,7 +112,7 @@ const _sfc_main = {
|
|
|
83
112
|
};
|
|
84
113
|
}
|
|
85
114
|
};
|
|
86
|
-
const _Tabs = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
115
|
+
const _Tabs = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3ac885e8"]]);
|
|
87
116
|
export {
|
|
88
117
|
_Tabs as default
|
|
89
118
|
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { onUnmounted, onBeforeUnmount, onMounted } from "vue";
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
/* empty css */
|
|
5
|
+
/* empty css */
|
|
6
|
+
/* empty css */
|
|
7
|
+
/* empty css */
|
|
8
|
+
/* empty css */
|
|
9
|
+
/* empty css */
|
|
10
|
+
import { useEventFlow } from "../utils/eventFlow/eventFlowHandler.mjs";
|
|
11
|
+
function usePageEvents(getOptions) {
|
|
12
|
+
if (typeof getOptions !== "function") {
|
|
13
|
+
const staticOptions = getOptions;
|
|
14
|
+
getOptions = () => staticOptions;
|
|
15
|
+
}
|
|
16
|
+
const executeEvent = async (eventName) => {
|
|
17
|
+
const options = getOptions();
|
|
18
|
+
const { pageEventConfig, instance, formData, localConfig, components, fields, initSearchData } = options;
|
|
19
|
+
if (!pageEventConfig || !Array.isArray(pageEventConfig) || pageEventConfig.length === 0) {
|
|
20
|
+
console.log(`页面事件 ${eventName} 未配置或配置未加载完成,跳过执行`);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const eventConfig = pageEventConfig.find((e) => e.name === eventName);
|
|
24
|
+
if (!eventConfig || !eventConfig.eventFlow) {
|
|
25
|
+
console.log(`页面事件 ${eventName} 未找到事件流配置,跳过执行`);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const { getEventHandlers: createEventHandlers } = useEventFlow({
|
|
29
|
+
fields: fields || [],
|
|
30
|
+
instance,
|
|
31
|
+
localConfig: localConfig || {},
|
|
32
|
+
components: components || {},
|
|
33
|
+
metadata: {
|
|
34
|
+
initSearchData
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const handler = createEventHandlers(
|
|
38
|
+
{},
|
|
39
|
+
formData || {},
|
|
40
|
+
[eventConfig]
|
|
41
|
+
);
|
|
42
|
+
const eventKeys = Object.keys(handler);
|
|
43
|
+
if (eventKeys.length > 0) {
|
|
44
|
+
console.log(`执行页面事件 ${eventName}`);
|
|
45
|
+
await handler[eventKeys[0]]();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const handleCreated = (checkConfigLoaded) => {
|
|
49
|
+
console.log("🚀 页面 onCreated 事件处理器已注册(将在配置加载完成后触发)");
|
|
50
|
+
};
|
|
51
|
+
const handleMounted = (checkConfigLoaded) => {
|
|
52
|
+
onMounted(() => {
|
|
53
|
+
console.log("🚀 页面 onMounted 事件触发");
|
|
54
|
+
executeEvent("onMounted");
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
const handleBeforeUnmount = () => {
|
|
58
|
+
onBeforeUnmount(() => {
|
|
59
|
+
console.log("🧹 页面 onBeforeUnmount 事件触发");
|
|
60
|
+
executeEvent("onBeforeUnmount");
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
const handleUnmounted = () => {
|
|
64
|
+
onUnmounted(() => {
|
|
65
|
+
console.log("✅ 页面 onUnmounted 事件触发");
|
|
66
|
+
executeEvent("onUnmounted");
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
return {
|
|
70
|
+
handleCreated,
|
|
71
|
+
handleMounted,
|
|
72
|
+
handleBeforeUnmount,
|
|
73
|
+
handleUnmounted,
|
|
74
|
+
executeEvent
|
|
75
|
+
// 导出 executeEvent 方法,方便在配置加载完成后立即触发 onCreated
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
usePageEvents
|
|
80
|
+
};
|