widget.qw 1.0.61 → 1.0.63
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/build/style.css +7 -6
- package/build/widget.qw.es.js +125 -113
- package/build/widget.qw.umd.js +125 -113
- package/package.json +1 -1
- package/src/components/ObjsEditor.vue +95 -72
package/build/style.css
CHANGED
|
@@ -840,21 +840,22 @@
|
|
|
840
840
|
}
|
|
841
841
|
.widget .readonly-field[data-v-0c8e09c0] {
|
|
842
842
|
margin: 4px 0;
|
|
843
|
-
}.widget[data-v-
|
|
843
|
+
}.widget[data-v-60c690c1] {
|
|
844
844
|
background: #fff;
|
|
845
845
|
box-sizing: border-box;
|
|
846
846
|
height: 100%;
|
|
847
847
|
text-align: left;
|
|
848
848
|
}
|
|
849
|
-
.
|
|
849
|
+
.option[data-v-60c690c1] {
|
|
850
850
|
margin: 0 8px 8px 0;
|
|
851
851
|
padding: 5px 5px;
|
|
852
|
-
border-radius:
|
|
853
|
-
|
|
854
|
-
|
|
852
|
+
border-radius: 6px;
|
|
853
|
+
border: 2px solid #e1e1e1;
|
|
854
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
|
855
|
+
color: #666;
|
|
855
856
|
display: inline-block;
|
|
856
857
|
position: relative;
|
|
857
858
|
}
|
|
858
|
-
[data-v-
|
|
859
|
+
[data-v-60c690c1] .van-field__label {
|
|
859
860
|
margin: auto;
|
|
860
861
|
}
|
package/build/widget.qw.es.js
CHANGED
|
@@ -17187,7 +17187,7 @@ const _hoisted_5$8 = {
|
|
|
17187
17187
|
class: "select-all-container"
|
|
17188
17188
|
};
|
|
17189
17189
|
const _hoisted_6$7 = /* @__PURE__ */ createTextVNode("\u5168\u9009");
|
|
17190
|
-
const _hoisted_7$
|
|
17190
|
+
const _hoisted_7$7 = {
|
|
17191
17191
|
class: "checkbox-style"
|
|
17192
17192
|
};
|
|
17193
17193
|
const _sfc_main$n = {
|
|
@@ -17430,7 +17430,7 @@ const _sfc_main$n = {
|
|
|
17430
17430
|
}, {
|
|
17431
17431
|
default: withCtx(() => [_hoisted_6$7]),
|
|
17432
17432
|
_: 1
|
|
17433
|
-
}, 8, ["modelValue"])])) : createCommentVNode("", true), createElementVNode("div", _hoisted_7$
|
|
17433
|
+
}, 8, ["modelValue"])])) : createCommentVNode("", true), createElementVNode("div", _hoisted_7$7, [props.multiple ? (openBlock(), createBlock(_component_van_checkbox_group, {
|
|
17434
17434
|
key: 0,
|
|
17435
17435
|
modelValue: checkedValue.value,
|
|
17436
17436
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => checkedValue.value = $event)
|
|
@@ -17577,7 +17577,7 @@ const _hoisted_5$7 = {
|
|
|
17577
17577
|
class: "action-buttons"
|
|
17578
17578
|
};
|
|
17579
17579
|
const _hoisted_6$6 = /* @__PURE__ */ createTextVNode(" \u53D6\u6D88 ");
|
|
17580
|
-
const _hoisted_7$
|
|
17580
|
+
const _hoisted_7$6 = /* @__PURE__ */ createTextVNode(" \u786E\u5B9A ");
|
|
17581
17581
|
const _hoisted_8$4 = {
|
|
17582
17582
|
class: "scroll-container"
|
|
17583
17583
|
};
|
|
@@ -17871,7 +17871,7 @@ const _sfc_main$l = {
|
|
|
17871
17871
|
disabled: !tempSelectedDepartment.value,
|
|
17872
17872
|
class: "confirm-btn"
|
|
17873
17873
|
}, {
|
|
17874
|
-
default: withCtx(() => [_hoisted_7$
|
|
17874
|
+
default: withCtx(() => [_hoisted_7$6]),
|
|
17875
17875
|
_: 1
|
|
17876
17876
|
}, 8, ["disabled"])])]), createVNode(_component_van_field, {
|
|
17877
17877
|
"left-icon": "search",
|
|
@@ -17939,7 +17939,7 @@ const _hoisted_5$6 = {
|
|
|
17939
17939
|
const _hoisted_6$5 = {
|
|
17940
17940
|
class: "header-right"
|
|
17941
17941
|
};
|
|
17942
|
-
const _hoisted_7$
|
|
17942
|
+
const _hoisted_7$5 = /* @__PURE__ */ createTextVNode("\u6E05\u7A7A");
|
|
17943
17943
|
const _hoisted_8$3 = /* @__PURE__ */ createTextVNode("\u786E\u5B9A");
|
|
17944
17944
|
const _hoisted_9$1 = {
|
|
17945
17945
|
key: 0,
|
|
@@ -18334,7 +18334,7 @@ const _sfc_main$k = {
|
|
|
18334
18334
|
onClick: handleClear,
|
|
18335
18335
|
class: "cancel-btn"
|
|
18336
18336
|
}, {
|
|
18337
|
-
default: withCtx(() => [_hoisted_7$
|
|
18337
|
+
default: withCtx(() => [_hoisted_7$5]),
|
|
18338
18338
|
_: 1
|
|
18339
18339
|
}), createVNode(_component_van_button, {
|
|
18340
18340
|
type: "primary",
|
|
@@ -18861,7 +18861,7 @@ const _hoisted_5$5 = {
|
|
|
18861
18861
|
class: "header-right"
|
|
18862
18862
|
};
|
|
18863
18863
|
const _hoisted_6$4 = /* @__PURE__ */ createTextVNode("\u6E05\u7A7A");
|
|
18864
|
-
const _hoisted_7$
|
|
18864
|
+
const _hoisted_7$4 = /* @__PURE__ */ createTextVNode("\u786E\u5B9A");
|
|
18865
18865
|
const _hoisted_8$2 = {
|
|
18866
18866
|
class: "scroll-container"
|
|
18867
18867
|
};
|
|
@@ -19149,7 +19149,7 @@ const _sfc_main$g = {
|
|
|
19149
19149
|
onClick: confirmSelection,
|
|
19150
19150
|
class: "confirm-btn"
|
|
19151
19151
|
}, {
|
|
19152
|
-
default: withCtx(() => [_hoisted_7$
|
|
19152
|
+
default: withCtx(() => [_hoisted_7$4]),
|
|
19153
19153
|
_: 1
|
|
19154
19154
|
})])]), createVNode(_component_van_search, {
|
|
19155
19155
|
modelValue: searchValue.value,
|
|
@@ -19217,7 +19217,7 @@ const _hoisted_5$4 = {
|
|
|
19217
19217
|
class: "header-right"
|
|
19218
19218
|
};
|
|
19219
19219
|
const _hoisted_6$3 = /* @__PURE__ */ createTextVNode("\u53D6\u6D88");
|
|
19220
|
-
const _hoisted_7$
|
|
19220
|
+
const _hoisted_7$3 = /* @__PURE__ */ createTextVNode("\u786E\u5B9A");
|
|
19221
19221
|
const _hoisted_8$1 = {
|
|
19222
19222
|
class: "scroll-container"
|
|
19223
19223
|
};
|
|
@@ -19421,7 +19421,7 @@ const _sfc_main$f = {
|
|
|
19421
19421
|
onClick: onSubmit,
|
|
19422
19422
|
class: "confirm-btn"
|
|
19423
19423
|
}, {
|
|
19424
|
-
default: withCtx(() => [_hoisted_7$
|
|
19424
|
+
default: withCtx(() => [_hoisted_7$3]),
|
|
19425
19425
|
_: 1
|
|
19426
19426
|
})])]), createVNode(_component_van_search, {
|
|
19427
19427
|
modelValue: data2.keyword,
|
|
@@ -19734,7 +19734,7 @@ const _hoisted_5$3 = {
|
|
|
19734
19734
|
const _hoisted_6$2 = {
|
|
19735
19735
|
class: "user-jobs"
|
|
19736
19736
|
};
|
|
19737
|
-
const _hoisted_7$
|
|
19737
|
+
const _hoisted_7$2 = /* @__PURE__ */ createTextVNode(" \u6CE8\u9500 ");
|
|
19738
19738
|
const _sfc_main$c = {
|
|
19739
19739
|
__name: "UserProfile",
|
|
19740
19740
|
props: {
|
|
@@ -19788,7 +19788,7 @@ const _sfc_main$c = {
|
|
|
19788
19788
|
class: "logout-button",
|
|
19789
19789
|
onClick: onLogout
|
|
19790
19790
|
}, {
|
|
19791
|
-
default: withCtx(() => [_hoisted_7$
|
|
19791
|
+
default: withCtx(() => [_hoisted_7$2]),
|
|
19792
19792
|
_: 1
|
|
19793
19793
|
})]);
|
|
19794
19794
|
};
|
|
@@ -20457,7 +20457,7 @@ const _hoisted_5$1 = {
|
|
|
20457
20457
|
class: "header-right"
|
|
20458
20458
|
};
|
|
20459
20459
|
const _hoisted_6$1 = /* @__PURE__ */ createTextVNode("\u53D6\u6D88");
|
|
20460
|
-
const _hoisted_7 = /* @__PURE__ */ createTextVNode("\u786E\u5B9A");
|
|
20460
|
+
const _hoisted_7$1 = /* @__PURE__ */ createTextVNode("\u786E\u5B9A");
|
|
20461
20461
|
const _hoisted_8 = {
|
|
20462
20462
|
class: "scroll-container"
|
|
20463
20463
|
};
|
|
@@ -20622,7 +20622,7 @@ const _sfc_main$3 = {
|
|
|
20622
20622
|
onClick: onSubmit,
|
|
20623
20623
|
class: "confirm-btn"
|
|
20624
20624
|
}, {
|
|
20625
|
-
default: withCtx(() => [_hoisted_7]),
|
|
20625
|
+
default: withCtx(() => [_hoisted_7$1]),
|
|
20626
20626
|
_: 1
|
|
20627
20627
|
})])]), createVNode(_component_van_search, {
|
|
20628
20628
|
modelValue: data2.keyword,
|
|
@@ -20946,26 +20946,30 @@ const _sfc_main$1 = {
|
|
|
20946
20946
|
}
|
|
20947
20947
|
};
|
|
20948
20948
|
var SingleApiPicker = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-0c8e09c0"]]);
|
|
20949
|
-
var ObjsEditor_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-
|
|
20949
|
+
var ObjsEditor_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-60c690c1] {\n background: #fff;\n box-sizing: border-box;\n height: 100%;\n text-align: left;\n}\n.option[data-v-60c690c1] {\n margin: 0 8px 8px 0;\n padding: 5px 5px;\n border-radius: 6px;\n border: 2px solid #e1e1e1;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n color: #666;\n display: inline-block;\n position: relative;\n}\n[data-v-60c690c1] .van-field__label {\n margin: auto;\n}")();
|
|
20950
20950
|
const _hoisted_1 = {
|
|
20951
|
+
class: "widget-box"
|
|
20952
|
+
};
|
|
20953
|
+
const _hoisted_2 = {
|
|
20954
|
+
key: 0,
|
|
20951
20955
|
style: {
|
|
20952
20956
|
"display": "flex",
|
|
20953
20957
|
"align-items": "center"
|
|
20954
20958
|
}
|
|
20955
20959
|
};
|
|
20956
|
-
const
|
|
20960
|
+
const _hoisted_3 = {
|
|
20957
20961
|
style: {
|
|
20958
20962
|
"padding": "5px 5px"
|
|
20959
20963
|
}
|
|
20960
20964
|
};
|
|
20961
|
-
const
|
|
20965
|
+
const _hoisted_4 = {
|
|
20962
20966
|
style: {
|
|
20963
20967
|
"display": "flex",
|
|
20964
20968
|
"flex-direction": "column",
|
|
20965
20969
|
"cursor": "pointer"
|
|
20966
20970
|
}
|
|
20967
20971
|
};
|
|
20968
|
-
const
|
|
20972
|
+
const _hoisted_5 = {
|
|
20969
20973
|
style: {
|
|
20970
20974
|
"margin": "16px",
|
|
20971
20975
|
"display": "flex",
|
|
@@ -20973,8 +20977,8 @@ const _hoisted_4 = {
|
|
|
20973
20977
|
"justify-content": "center"
|
|
20974
20978
|
}
|
|
20975
20979
|
};
|
|
20976
|
-
const
|
|
20977
|
-
const
|
|
20980
|
+
const _hoisted_6 = /* @__PURE__ */ createTextVNode("\u4FDD\u5B58");
|
|
20981
|
+
const _hoisted_7 = /* @__PURE__ */ createTextVNode("\u53D6\u6D88");
|
|
20978
20982
|
const _sfc_main = {
|
|
20979
20983
|
__name: "ObjsEditor",
|
|
20980
20984
|
props: {
|
|
@@ -21027,10 +21031,18 @@ const _sfc_main = {
|
|
|
21027
21031
|
const data2 = reactive({
|
|
21028
21032
|
inputValue: {},
|
|
21029
21033
|
isShowInput: false,
|
|
21030
|
-
selectIndex: -1
|
|
21034
|
+
selectIndex: -1,
|
|
21035
|
+
oldModelValue: []
|
|
21031
21036
|
});
|
|
21032
21037
|
const keys2 = Object.keys(props.schema);
|
|
21033
21038
|
const visiableKeys = keys2.filter((k) => props.schema[k].auth != "gone");
|
|
21039
|
+
watch(() => JSON.stringify(modelValue.value), (n, o) => {
|
|
21040
|
+
data2.oldModelValue = JSON.parse(JSON.stringify(modelValue.value));
|
|
21041
|
+
}, {
|
|
21042
|
+
immediate: true
|
|
21043
|
+
}, {
|
|
21044
|
+
deep: true
|
|
21045
|
+
});
|
|
21034
21046
|
onMounted(() => {
|
|
21035
21047
|
init();
|
|
21036
21048
|
});
|
|
@@ -21097,14 +21109,17 @@ const _sfc_main = {
|
|
|
21097
21109
|
}
|
|
21098
21110
|
};
|
|
21099
21111
|
const onEdit = (index) => {
|
|
21100
|
-
data2.isShowInput = true;
|
|
21101
21112
|
data2.selectIndex = index;
|
|
21102
|
-
data2.inputValue = modelValue.value[data2.selectIndex];
|
|
21113
|
+
data2.inputValue = JSON.parse(JSON.stringify(modelValue.value[data2.selectIndex]));
|
|
21114
|
+
data2.isShowInput = true;
|
|
21103
21115
|
};
|
|
21104
21116
|
const onNewOption = () => {
|
|
21105
|
-
|
|
21106
|
-
|
|
21107
|
-
|
|
21117
|
+
let oldModelValue = JSON.parse(JSON.stringify(modelValue.value));
|
|
21118
|
+
modelValue.value = [...modelValue.value, makeDefaultValue()];
|
|
21119
|
+
nextTick(() => {
|
|
21120
|
+
data2.oldModelValue = oldModelValue;
|
|
21121
|
+
onEdit(modelValue.value.length - 1);
|
|
21122
|
+
});
|
|
21108
21123
|
};
|
|
21109
21124
|
const onInputConfirm = () => {
|
|
21110
21125
|
let idx = modelValue.value.indexOf((item) => JSON.stringify(item) === JSON.stringify(data2.inputValue));
|
|
@@ -21115,19 +21130,20 @@ const _sfc_main = {
|
|
|
21115
21130
|
if (!data2.inputValue) {
|
|
21116
21131
|
data2.isShowInput = false;
|
|
21117
21132
|
data2.inputValue = makeDefaultValue();
|
|
21133
|
+
data2.selectIndex = -1;
|
|
21134
|
+
modelValue.value = data2.oldModelValue;
|
|
21118
21135
|
return;
|
|
21119
21136
|
}
|
|
21120
|
-
|
|
21121
|
-
modelValue.value.push(data2.inputValue);
|
|
21122
|
-
} else {
|
|
21123
|
-
modelValue.value[data2.selectIndex] = data2.inputValue;
|
|
21124
|
-
}
|
|
21137
|
+
modelValue.value[data2.selectIndex] = data2.inputValue;
|
|
21125
21138
|
data2.isShowInput = false;
|
|
21126
21139
|
data2.inputValue = makeDefaultValue();
|
|
21140
|
+
data2.selectIndex = -1;
|
|
21127
21141
|
};
|
|
21128
21142
|
const onInputCancel = () => {
|
|
21129
21143
|
data2.isShowInput = false;
|
|
21130
21144
|
data2.inputValue = makeDefaultValue();
|
|
21145
|
+
data2.selectIndex = -1;
|
|
21146
|
+
modelValue.value = data2.oldModelValue;
|
|
21131
21147
|
};
|
|
21132
21148
|
const onChangeOption = (key) => {
|
|
21133
21149
|
var _a, _b;
|
|
@@ -21154,21 +21170,21 @@ const _sfc_main = {
|
|
|
21154
21170
|
required: unref(isRequired),
|
|
21155
21171
|
placeholder: props.placeholder
|
|
21156
21172
|
}, {
|
|
21157
|
-
input: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(modelValue), (item, index) => {
|
|
21173
|
+
input: withCtx(() => [createElementVNode("div", _hoisted_1, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(modelValue), (item, index) => {
|
|
21158
21174
|
return openBlock(), createElementBlock("div", {
|
|
21159
21175
|
class: "option",
|
|
21160
21176
|
key: index
|
|
21161
|
-
}, [
|
|
21177
|
+
}, [index != data2.selectIndex ? (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(_component_van_icon, {
|
|
21162
21178
|
name: "arrow-left",
|
|
21163
21179
|
onClick: withModifiers(($event) => onForward(index), ["stop"])
|
|
21164
|
-
}, null, 8, ["onClick"]), createElementVNode("div",
|
|
21180
|
+
}, null, 8, ["onClick"]), createElementVNode("div", _hoisted_3, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(visiableKeys), (k, j) => {
|
|
21165
21181
|
return openBlock(), createElementBlock("div", {
|
|
21166
21182
|
key: j,
|
|
21167
21183
|
style: {
|
|
21168
21184
|
"padding": "2px 2px"
|
|
21169
21185
|
}
|
|
21170
21186
|
}, toDisplayString(`${key2name(k)}:${key2value(k, item)}`), 1);
|
|
21171
|
-
}), 128))]), createElementVNode("div",
|
|
21187
|
+
}), 128))]), createElementVNode("div", _hoisted_4, [props.schema.auth != "readonly" && props.auth != "readonly" && props.auth != "disabled" ? (openBlock(), createBlock(_component_van_icon, {
|
|
21172
21188
|
key: 0,
|
|
21173
21189
|
name: "edit",
|
|
21174
21190
|
onClick: withModifiers(($event) => onEdit(index), ["stop"])
|
|
@@ -21182,93 +21198,89 @@ const _sfc_main = {
|
|
|
21182
21198
|
key: 1,
|
|
21183
21199
|
name: "cross",
|
|
21184
21200
|
onClick: withModifiers(($event) => onDelete(index), ["stop"])
|
|
21185
|
-
}, null, 8, ["onClick"])) : createCommentVNode("", true)])])
|
|
21201
|
+
}, null, 8, ["onClick"])) : createCommentVNode("", true)])])) : createCommentVNode("", true), data2.isShowInput && index == data2.selectIndex ? (openBlock(), createBlock(_component_van_form, {
|
|
21202
|
+
key: 1,
|
|
21203
|
+
model: data2.inputValue
|
|
21204
|
+
}, {
|
|
21205
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(keys2), (key, i) => {
|
|
21206
|
+
return withDirectives((openBlock(), createBlock(_component_van_field, {
|
|
21207
|
+
key: i,
|
|
21208
|
+
label: props.schema[key].label,
|
|
21209
|
+
required: props.schema[key].auth === "required",
|
|
21210
|
+
disabled: props.schema[key].auth === "readonly"
|
|
21211
|
+
}, {
|
|
21212
|
+
input: withCtx(() => {
|
|
21213
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
21214
|
+
return [props.schema[key].type == "String" && !((_b = (_a = props.schema[key]) == null ? void 0 : _a.schema) == null ? void 0 : _b.options) ? (openBlock(), createBlock(_component_van_field, {
|
|
21215
|
+
key: 0,
|
|
21216
|
+
modelValue: data2.inputValue[key],
|
|
21217
|
+
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21218
|
+
placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
|
|
21219
|
+
type: "text"
|
|
21220
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : createCommentVNode("", true), props.schema[key].type == "Number" && !((_d = (_c = props.schema[key]) == null ? void 0 : _c.schema) == null ? void 0 : _d.options) ? (openBlock(), createBlock(_component_van_field, {
|
|
21221
|
+
key: 1,
|
|
21222
|
+
modelValue: data2.inputValue[key],
|
|
21223
|
+
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21224
|
+
modelModifiers: {
|
|
21225
|
+
number: true
|
|
21226
|
+
},
|
|
21227
|
+
placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
|
|
21228
|
+
type: "number"
|
|
21229
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : createCommentVNode("", true), props.schema[key].type == "Boolean" ? (openBlock(), createBlock(_component_van_switch, {
|
|
21230
|
+
key: 2,
|
|
21231
|
+
modelValue: data2.inputValue[key],
|
|
21232
|
+
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event
|
|
21233
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("", true), props.schema[key].type == "Datetime" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
21234
|
+
key: 3,
|
|
21235
|
+
modelValue: data2.inputValue[key],
|
|
21236
|
+
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21237
|
+
placeholder: "\u9009\u62E9\u65F6\u95F4"
|
|
21238
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("", true), ((_f = (_e = props.schema[key]) == null ? void 0 : _e.schema) == null ? void 0 : _f.options) ? (openBlock(), createBlock(DataSelector, {
|
|
21239
|
+
key: 4,
|
|
21240
|
+
modelValue: data2.inputValue[key],
|
|
21241
|
+
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21242
|
+
options: (_h = (_g = props.schema[key]) == null ? void 0 : _g.schema) == null ? void 0 : _h.options,
|
|
21243
|
+
placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
|
|
21244
|
+
columnsFieldNames: {
|
|
21245
|
+
text: (((_j = (_i = props.schema[key]) == null ? void 0 : _i.schema) == null ? void 0 : _j.options) || []).length > 0 ? Object.keys(props.schema[key].schema.options[0])[0] : "",
|
|
21246
|
+
value: (((_l = (_k = props.schema[key]) == null ? void 0 : _k.schema) == null ? void 0 : _l.options) || []).length > 0 ? Object.keys(props.schema[key].schema.options[0])[1] : ""
|
|
21247
|
+
},
|
|
21248
|
+
onSelect: ($event) => onChangeOption(key)
|
|
21249
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "options", "placeholder", "columnsFieldNames", "onSelect"])) : createCommentVNode("", true), props.schema[key].type == "Array" && props.schema[key].auth != "gone" ? (openBlock(), createBlock(_component_ObjsEditor, {
|
|
21250
|
+
key: 5,
|
|
21251
|
+
modelValue: data2.inputValue[key],
|
|
21252
|
+
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21253
|
+
schema: props.schema[key].schema
|
|
21254
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "schema"])) : createCommentVNode("", true)];
|
|
21255
|
+
}),
|
|
21256
|
+
_: 2
|
|
21257
|
+
}, 1032, ["label", "required", "disabled"])), [[vShow, props.schema[key].auth != "gone"]]);
|
|
21258
|
+
}), 128)), createElementVNode("div", _hoisted_5, [data2.isShowInput ? (openBlock(), createBlock(_component_van_button, {
|
|
21259
|
+
key: 0,
|
|
21260
|
+
onClick: onInputConfirm
|
|
21261
|
+
}, {
|
|
21262
|
+
default: withCtx(() => [_hoisted_6]),
|
|
21263
|
+
_: 1
|
|
21264
|
+
})) : createCommentVNode("", true), data2.isShowInput ? (openBlock(), createBlock(_component_van_button, {
|
|
21265
|
+
key: 1,
|
|
21266
|
+
onClick: onInputCancel
|
|
21267
|
+
}, {
|
|
21268
|
+
default: withCtx(() => [_hoisted_7]),
|
|
21269
|
+
_: 1
|
|
21270
|
+
})) : createCommentVNode("", true)])]),
|
|
21271
|
+
_: 1
|
|
21272
|
+
}, 8, ["model"])) : createCommentVNode("", true)]);
|
|
21186
21273
|
}), 128)), !data2.isShowInput && props.auth != "readonly" && props.auth != "disabled" ? (openBlock(), createBlock(_component_van_icon, {
|
|
21187
21274
|
key: 0,
|
|
21188
21275
|
name: "plus",
|
|
21189
21276
|
onClick: onNewOption
|
|
21190
|
-
})) : createCommentVNode("", true)
|
|
21191
|
-
key: 1,
|
|
21192
|
-
model: data2.inputValue
|
|
21193
|
-
}, {
|
|
21194
|
-
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(keys2), (key, i) => {
|
|
21195
|
-
return withDirectives((openBlock(), createBlock(_component_van_field, {
|
|
21196
|
-
key: i,
|
|
21197
|
-
label: props.schema[key].label,
|
|
21198
|
-
required: props.schema[key].auth === "required",
|
|
21199
|
-
disabled: props.schema[key].auth === "readonly"
|
|
21200
|
-
}, {
|
|
21201
|
-
input: withCtx(() => {
|
|
21202
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
21203
|
-
return [props.schema[key].type == "String" && !((_b = (_a = props.schema[key]) == null ? void 0 : _a.schema) == null ? void 0 : _b.options) ? (openBlock(), createBlock(_component_van_field, {
|
|
21204
|
-
key: 0,
|
|
21205
|
-
modelValue: data2.inputValue[key],
|
|
21206
|
-
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21207
|
-
placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
|
|
21208
|
-
type: "text"
|
|
21209
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : createCommentVNode("", true), props.schema[key].type == "Number" && !((_d = (_c = props.schema[key]) == null ? void 0 : _c.schema) == null ? void 0 : _d.options) ? (openBlock(), createBlock(_component_van_field, {
|
|
21210
|
-
key: 1,
|
|
21211
|
-
modelValue: data2.inputValue[key],
|
|
21212
|
-
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21213
|
-
modelModifiers: {
|
|
21214
|
-
number: true
|
|
21215
|
-
},
|
|
21216
|
-
placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
|
|
21217
|
-
type: "number"
|
|
21218
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : createCommentVNode("", true), props.schema[key].type == "Boolean" ? (openBlock(), createBlock(_component_van_switch, {
|
|
21219
|
-
key: 2,
|
|
21220
|
-
modelValue: data2.inputValue[key],
|
|
21221
|
-
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event
|
|
21222
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("", true), props.schema[key].type == "Datetime" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
21223
|
-
key: 3,
|
|
21224
|
-
modelValue: data2.inputValue[key],
|
|
21225
|
-
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21226
|
-
placeholder: "\u9009\u62E9\u65F6\u95F4"
|
|
21227
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("", true), ((_f = (_e = props.schema[key]) == null ? void 0 : _e.schema) == null ? void 0 : _f.options) ? (openBlock(), createBlock(DataSelector, {
|
|
21228
|
-
key: 4,
|
|
21229
|
-
modelValue: data2.inputValue[key],
|
|
21230
|
-
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21231
|
-
options: (_h = (_g = props.schema[key]) == null ? void 0 : _g.schema) == null ? void 0 : _h.options,
|
|
21232
|
-
placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
|
|
21233
|
-
columnsFieldNames: {
|
|
21234
|
-
text: (((_j = (_i = props.schema[key]) == null ? void 0 : _i.schema) == null ? void 0 : _j.options) || []).length > 0 ? Object.keys(props.schema[key].schema.options[0])[0] : "",
|
|
21235
|
-
value: (((_l = (_k = props.schema[key]) == null ? void 0 : _k.schema) == null ? void 0 : _l.options) || []).length > 0 ? Object.keys(props.schema[key].schema.options[0])[1] : ""
|
|
21236
|
-
},
|
|
21237
|
-
onSelect: ($event) => onChangeOption(key)
|
|
21238
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "options", "placeholder", "columnsFieldNames", "onSelect"])) : createCommentVNode("", true), props.schema[key].type == "Array" && props.schema[key].auth != "gone" ? (openBlock(), createBlock(_component_ObjsEditor, {
|
|
21239
|
-
key: 5,
|
|
21240
|
-
modelValue: data2.inputValue[key],
|
|
21241
|
-
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21242
|
-
schema: props.schema[key].schema
|
|
21243
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "schema"])) : createCommentVNode("", true)];
|
|
21244
|
-
}),
|
|
21245
|
-
_: 2
|
|
21246
|
-
}, 1032, ["label", "required", "disabled"])), [[vShow, props.schema[key].auth != "gone"]]);
|
|
21247
|
-
}), 128)), createElementVNode("div", _hoisted_4, [data2.isShowInput ? (openBlock(), createBlock(_component_van_button, {
|
|
21248
|
-
key: 0,
|
|
21249
|
-
onClick: onInputConfirm,
|
|
21250
|
-
type: "primary",
|
|
21251
|
-
size: "mini"
|
|
21252
|
-
}, {
|
|
21253
|
-
default: withCtx(() => [_hoisted_5]),
|
|
21254
|
-
_: 1
|
|
21255
|
-
})) : createCommentVNode("", true), data2.isShowInput ? (openBlock(), createBlock(_component_van_button, {
|
|
21256
|
-
key: 1,
|
|
21257
|
-
onClick: onInputCancel,
|
|
21258
|
-
type: "primary",
|
|
21259
|
-
size: "mini"
|
|
21260
|
-
}, {
|
|
21261
|
-
default: withCtx(() => [_hoisted_6]),
|
|
21262
|
-
_: 1
|
|
21263
|
-
})) : createCommentVNode("", true)])]),
|
|
21264
|
-
_: 1
|
|
21265
|
-
}, 8, ["model"])) : createCommentVNode("", true)]),
|
|
21277
|
+
})) : createCommentVNode("", true)])]),
|
|
21266
21278
|
_: 1
|
|
21267
21279
|
}, 8, ["label", "disabled", "required", "placeholder"])) : createCommentVNode("", true);
|
|
21268
21280
|
};
|
|
21269
21281
|
}
|
|
21270
21282
|
};
|
|
21271
|
-
var ObjsEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
21283
|
+
var ObjsEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-60c690c1"]]);
|
|
21272
21284
|
const secret_notify = () => {
|
|
21273
21285
|
showNotify({ type: "danger", message: "\u4E25\u683C\u6267\u884C\u4FE1\u606F\u4FDD\u5BC6\u8981\u6C42\uFF0C\u5207\u5B9E\u9632\u8303\u4F01\u4E1A\u6CC4\u5BC6\u98CE\u9669", duration: 3e3 });
|
|
21274
21286
|
};
|
package/build/widget.qw.umd.js
CHANGED
|
@@ -17190,7 +17190,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
17190
17190
|
class: "select-all-container"
|
|
17191
17191
|
};
|
|
17192
17192
|
const _hoisted_6$7 = /* @__PURE__ */ vue.createTextVNode("\u5168\u9009");
|
|
17193
|
-
const _hoisted_7$
|
|
17193
|
+
const _hoisted_7$7 = {
|
|
17194
17194
|
class: "checkbox-style"
|
|
17195
17195
|
};
|
|
17196
17196
|
const _sfc_main$n = {
|
|
@@ -17433,7 +17433,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
17433
17433
|
}, {
|
|
17434
17434
|
default: vue.withCtx(() => [_hoisted_6$7]),
|
|
17435
17435
|
_: 1
|
|
17436
|
-
}, 8, ["modelValue"])])) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_7$
|
|
17436
|
+
}, 8, ["modelValue"])])) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_7$7, [props.multiple ? (vue.openBlock(), vue.createBlock(_component_van_checkbox_group, {
|
|
17437
17437
|
key: 0,
|
|
17438
17438
|
modelValue: checkedValue.value,
|
|
17439
17439
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => checkedValue.value = $event)
|
|
@@ -17580,7 +17580,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
17580
17580
|
class: "action-buttons"
|
|
17581
17581
|
};
|
|
17582
17582
|
const _hoisted_6$6 = /* @__PURE__ */ vue.createTextVNode(" \u53D6\u6D88 ");
|
|
17583
|
-
const _hoisted_7$
|
|
17583
|
+
const _hoisted_7$6 = /* @__PURE__ */ vue.createTextVNode(" \u786E\u5B9A ");
|
|
17584
17584
|
const _hoisted_8$4 = {
|
|
17585
17585
|
class: "scroll-container"
|
|
17586
17586
|
};
|
|
@@ -17874,7 +17874,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
17874
17874
|
disabled: !tempSelectedDepartment.value,
|
|
17875
17875
|
class: "confirm-btn"
|
|
17876
17876
|
}, {
|
|
17877
|
-
default: vue.withCtx(() => [_hoisted_7$
|
|
17877
|
+
default: vue.withCtx(() => [_hoisted_7$6]),
|
|
17878
17878
|
_: 1
|
|
17879
17879
|
}, 8, ["disabled"])])]), vue.createVNode(_component_van_field, {
|
|
17880
17880
|
"left-icon": "search",
|
|
@@ -17942,7 +17942,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
17942
17942
|
const _hoisted_6$5 = {
|
|
17943
17943
|
class: "header-right"
|
|
17944
17944
|
};
|
|
17945
|
-
const _hoisted_7$
|
|
17945
|
+
const _hoisted_7$5 = /* @__PURE__ */ vue.createTextVNode("\u6E05\u7A7A");
|
|
17946
17946
|
const _hoisted_8$3 = /* @__PURE__ */ vue.createTextVNode("\u786E\u5B9A");
|
|
17947
17947
|
const _hoisted_9$1 = {
|
|
17948
17948
|
key: 0,
|
|
@@ -18337,7 +18337,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18337
18337
|
onClick: handleClear,
|
|
18338
18338
|
class: "cancel-btn"
|
|
18339
18339
|
}, {
|
|
18340
|
-
default: vue.withCtx(() => [_hoisted_7$
|
|
18340
|
+
default: vue.withCtx(() => [_hoisted_7$5]),
|
|
18341
18341
|
_: 1
|
|
18342
18342
|
}), vue.createVNode(_component_van_button, {
|
|
18343
18343
|
type: "primary",
|
|
@@ -18864,7 +18864,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18864
18864
|
class: "header-right"
|
|
18865
18865
|
};
|
|
18866
18866
|
const _hoisted_6$4 = /* @__PURE__ */ vue.createTextVNode("\u6E05\u7A7A");
|
|
18867
|
-
const _hoisted_7$
|
|
18867
|
+
const _hoisted_7$4 = /* @__PURE__ */ vue.createTextVNode("\u786E\u5B9A");
|
|
18868
18868
|
const _hoisted_8$2 = {
|
|
18869
18869
|
class: "scroll-container"
|
|
18870
18870
|
};
|
|
@@ -19152,7 +19152,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19152
19152
|
onClick: confirmSelection,
|
|
19153
19153
|
class: "confirm-btn"
|
|
19154
19154
|
}, {
|
|
19155
|
-
default: vue.withCtx(() => [_hoisted_7$
|
|
19155
|
+
default: vue.withCtx(() => [_hoisted_7$4]),
|
|
19156
19156
|
_: 1
|
|
19157
19157
|
})])]), vue.createVNode(_component_van_search, {
|
|
19158
19158
|
modelValue: searchValue.value,
|
|
@@ -19220,7 +19220,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19220
19220
|
class: "header-right"
|
|
19221
19221
|
};
|
|
19222
19222
|
const _hoisted_6$3 = /* @__PURE__ */ vue.createTextVNode("\u53D6\u6D88");
|
|
19223
|
-
const _hoisted_7$
|
|
19223
|
+
const _hoisted_7$3 = /* @__PURE__ */ vue.createTextVNode("\u786E\u5B9A");
|
|
19224
19224
|
const _hoisted_8$1 = {
|
|
19225
19225
|
class: "scroll-container"
|
|
19226
19226
|
};
|
|
@@ -19424,7 +19424,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19424
19424
|
onClick: onSubmit,
|
|
19425
19425
|
class: "confirm-btn"
|
|
19426
19426
|
}, {
|
|
19427
|
-
default: vue.withCtx(() => [_hoisted_7$
|
|
19427
|
+
default: vue.withCtx(() => [_hoisted_7$3]),
|
|
19428
19428
|
_: 1
|
|
19429
19429
|
})])]), vue.createVNode(_component_van_search, {
|
|
19430
19430
|
modelValue: data2.keyword,
|
|
@@ -19737,7 +19737,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19737
19737
|
const _hoisted_6$2 = {
|
|
19738
19738
|
class: "user-jobs"
|
|
19739
19739
|
};
|
|
19740
|
-
const _hoisted_7$
|
|
19740
|
+
const _hoisted_7$2 = /* @__PURE__ */ vue.createTextVNode(" \u6CE8\u9500 ");
|
|
19741
19741
|
const _sfc_main$c = {
|
|
19742
19742
|
__name: "UserProfile",
|
|
19743
19743
|
props: {
|
|
@@ -19791,7 +19791,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19791
19791
|
class: "logout-button",
|
|
19792
19792
|
onClick: onLogout
|
|
19793
19793
|
}, {
|
|
19794
|
-
default: vue.withCtx(() => [_hoisted_7$
|
|
19794
|
+
default: vue.withCtx(() => [_hoisted_7$2]),
|
|
19795
19795
|
_: 1
|
|
19796
19796
|
})]);
|
|
19797
19797
|
};
|
|
@@ -20460,7 +20460,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20460
20460
|
class: "header-right"
|
|
20461
20461
|
};
|
|
20462
20462
|
const _hoisted_6$1 = /* @__PURE__ */ vue.createTextVNode("\u53D6\u6D88");
|
|
20463
|
-
const _hoisted_7 = /* @__PURE__ */ vue.createTextVNode("\u786E\u5B9A");
|
|
20463
|
+
const _hoisted_7$1 = /* @__PURE__ */ vue.createTextVNode("\u786E\u5B9A");
|
|
20464
20464
|
const _hoisted_8 = {
|
|
20465
20465
|
class: "scroll-container"
|
|
20466
20466
|
};
|
|
@@ -20625,7 +20625,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20625
20625
|
onClick: onSubmit,
|
|
20626
20626
|
class: "confirm-btn"
|
|
20627
20627
|
}, {
|
|
20628
|
-
default: vue.withCtx(() => [_hoisted_7]),
|
|
20628
|
+
default: vue.withCtx(() => [_hoisted_7$1]),
|
|
20629
20629
|
_: 1
|
|
20630
20630
|
})])]), vue.createVNode(_component_van_search, {
|
|
20631
20631
|
modelValue: data2.keyword,
|
|
@@ -20949,26 +20949,30 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20949
20949
|
}
|
|
20950
20950
|
};
|
|
20951
20951
|
var SingleApiPicker = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-0c8e09c0"]]);
|
|
20952
|
-
var ObjsEditor_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-
|
|
20952
|
+
var ObjsEditor_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-60c690c1] {\n background: #fff;\n box-sizing: border-box;\n height: 100%;\n text-align: left;\n}\n.option[data-v-60c690c1] {\n margin: 0 8px 8px 0;\n padding: 5px 5px;\n border-radius: 6px;\n border: 2px solid #e1e1e1;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n color: #666;\n display: inline-block;\n position: relative;\n}\n[data-v-60c690c1] .van-field__label {\n margin: auto;\n}")();
|
|
20953
20953
|
const _hoisted_1 = {
|
|
20954
|
+
class: "widget-box"
|
|
20955
|
+
};
|
|
20956
|
+
const _hoisted_2 = {
|
|
20957
|
+
key: 0,
|
|
20954
20958
|
style: {
|
|
20955
20959
|
"display": "flex",
|
|
20956
20960
|
"align-items": "center"
|
|
20957
20961
|
}
|
|
20958
20962
|
};
|
|
20959
|
-
const
|
|
20963
|
+
const _hoisted_3 = {
|
|
20960
20964
|
style: {
|
|
20961
20965
|
"padding": "5px 5px"
|
|
20962
20966
|
}
|
|
20963
20967
|
};
|
|
20964
|
-
const
|
|
20968
|
+
const _hoisted_4 = {
|
|
20965
20969
|
style: {
|
|
20966
20970
|
"display": "flex",
|
|
20967
20971
|
"flex-direction": "column",
|
|
20968
20972
|
"cursor": "pointer"
|
|
20969
20973
|
}
|
|
20970
20974
|
};
|
|
20971
|
-
const
|
|
20975
|
+
const _hoisted_5 = {
|
|
20972
20976
|
style: {
|
|
20973
20977
|
"margin": "16px",
|
|
20974
20978
|
"display": "flex",
|
|
@@ -20976,8 +20980,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20976
20980
|
"justify-content": "center"
|
|
20977
20981
|
}
|
|
20978
20982
|
};
|
|
20979
|
-
const
|
|
20980
|
-
const
|
|
20983
|
+
const _hoisted_6 = /* @__PURE__ */ vue.createTextVNode("\u4FDD\u5B58");
|
|
20984
|
+
const _hoisted_7 = /* @__PURE__ */ vue.createTextVNode("\u53D6\u6D88");
|
|
20981
20985
|
const _sfc_main = {
|
|
20982
20986
|
__name: "ObjsEditor",
|
|
20983
20987
|
props: {
|
|
@@ -21030,10 +21034,18 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21030
21034
|
const data2 = vue.reactive({
|
|
21031
21035
|
inputValue: {},
|
|
21032
21036
|
isShowInput: false,
|
|
21033
|
-
selectIndex: -1
|
|
21037
|
+
selectIndex: -1,
|
|
21038
|
+
oldModelValue: []
|
|
21034
21039
|
});
|
|
21035
21040
|
const keys2 = Object.keys(props.schema);
|
|
21036
21041
|
const visiableKeys = keys2.filter((k) => props.schema[k].auth != "gone");
|
|
21042
|
+
vue.watch(() => JSON.stringify(modelValue.value), (n, o) => {
|
|
21043
|
+
data2.oldModelValue = JSON.parse(JSON.stringify(modelValue.value));
|
|
21044
|
+
}, {
|
|
21045
|
+
immediate: true
|
|
21046
|
+
}, {
|
|
21047
|
+
deep: true
|
|
21048
|
+
});
|
|
21037
21049
|
vue.onMounted(() => {
|
|
21038
21050
|
init();
|
|
21039
21051
|
});
|
|
@@ -21100,14 +21112,17 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21100
21112
|
}
|
|
21101
21113
|
};
|
|
21102
21114
|
const onEdit = (index) => {
|
|
21103
|
-
data2.isShowInput = true;
|
|
21104
21115
|
data2.selectIndex = index;
|
|
21105
|
-
data2.inputValue = modelValue.value[data2.selectIndex];
|
|
21116
|
+
data2.inputValue = JSON.parse(JSON.stringify(modelValue.value[data2.selectIndex]));
|
|
21117
|
+
data2.isShowInput = true;
|
|
21106
21118
|
};
|
|
21107
21119
|
const onNewOption = () => {
|
|
21108
|
-
|
|
21109
|
-
|
|
21110
|
-
|
|
21120
|
+
let oldModelValue = JSON.parse(JSON.stringify(modelValue.value));
|
|
21121
|
+
modelValue.value = [...modelValue.value, makeDefaultValue()];
|
|
21122
|
+
vue.nextTick(() => {
|
|
21123
|
+
data2.oldModelValue = oldModelValue;
|
|
21124
|
+
onEdit(modelValue.value.length - 1);
|
|
21125
|
+
});
|
|
21111
21126
|
};
|
|
21112
21127
|
const onInputConfirm = () => {
|
|
21113
21128
|
let idx = modelValue.value.indexOf((item) => JSON.stringify(item) === JSON.stringify(data2.inputValue));
|
|
@@ -21118,19 +21133,20 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21118
21133
|
if (!data2.inputValue) {
|
|
21119
21134
|
data2.isShowInput = false;
|
|
21120
21135
|
data2.inputValue = makeDefaultValue();
|
|
21136
|
+
data2.selectIndex = -1;
|
|
21137
|
+
modelValue.value = data2.oldModelValue;
|
|
21121
21138
|
return;
|
|
21122
21139
|
}
|
|
21123
|
-
|
|
21124
|
-
modelValue.value.push(data2.inputValue);
|
|
21125
|
-
} else {
|
|
21126
|
-
modelValue.value[data2.selectIndex] = data2.inputValue;
|
|
21127
|
-
}
|
|
21140
|
+
modelValue.value[data2.selectIndex] = data2.inputValue;
|
|
21128
21141
|
data2.isShowInput = false;
|
|
21129
21142
|
data2.inputValue = makeDefaultValue();
|
|
21143
|
+
data2.selectIndex = -1;
|
|
21130
21144
|
};
|
|
21131
21145
|
const onInputCancel = () => {
|
|
21132
21146
|
data2.isShowInput = false;
|
|
21133
21147
|
data2.inputValue = makeDefaultValue();
|
|
21148
|
+
data2.selectIndex = -1;
|
|
21149
|
+
modelValue.value = data2.oldModelValue;
|
|
21134
21150
|
};
|
|
21135
21151
|
const onChangeOption = (key) => {
|
|
21136
21152
|
var _a, _b;
|
|
@@ -21157,21 +21173,21 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21157
21173
|
required: vue.unref(isRequired),
|
|
21158
21174
|
placeholder: props.placeholder
|
|
21159
21175
|
}, {
|
|
21160
|
-
input: vue.withCtx(() => [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(modelValue), (item, index) => {
|
|
21176
|
+
input: vue.withCtx(() => [vue.createElementVNode("div", _hoisted_1, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(modelValue), (item, index) => {
|
|
21161
21177
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
21162
21178
|
class: "option",
|
|
21163
21179
|
key: index
|
|
21164
|
-
}, [vue.
|
|
21180
|
+
}, [index != data2.selectIndex ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [vue.createVNode(_component_van_icon, {
|
|
21165
21181
|
name: "arrow-left",
|
|
21166
21182
|
onClick: vue.withModifiers(($event) => onForward(index), ["stop"])
|
|
21167
|
-
}, null, 8, ["onClick"]), vue.createElementVNode("div",
|
|
21183
|
+
}, null, 8, ["onClick"]), vue.createElementVNode("div", _hoisted_3, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(visiableKeys), (k, j) => {
|
|
21168
21184
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
21169
21185
|
key: j,
|
|
21170
21186
|
style: {
|
|
21171
21187
|
"padding": "2px 2px"
|
|
21172
21188
|
}
|
|
21173
21189
|
}, vue.toDisplayString(`${key2name(k)}:${key2value(k, item)}`), 1);
|
|
21174
|
-
}), 128))]), vue.createElementVNode("div",
|
|
21190
|
+
}), 128))]), vue.createElementVNode("div", _hoisted_4, [props.schema.auth != "readonly" && props.auth != "readonly" && props.auth != "disabled" ? (vue.openBlock(), vue.createBlock(_component_van_icon, {
|
|
21175
21191
|
key: 0,
|
|
21176
21192
|
name: "edit",
|
|
21177
21193
|
onClick: vue.withModifiers(($event) => onEdit(index), ["stop"])
|
|
@@ -21185,93 +21201,89 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21185
21201
|
key: 1,
|
|
21186
21202
|
name: "cross",
|
|
21187
21203
|
onClick: vue.withModifiers(($event) => onDelete(index), ["stop"])
|
|
21188
|
-
}, null, 8, ["onClick"])) : vue.createCommentVNode("", true)])])
|
|
21204
|
+
}, null, 8, ["onClick"])) : vue.createCommentVNode("", true)])])) : vue.createCommentVNode("", true), data2.isShowInput && index == data2.selectIndex ? (vue.openBlock(), vue.createBlock(_component_van_form, {
|
|
21205
|
+
key: 1,
|
|
21206
|
+
model: data2.inputValue
|
|
21207
|
+
}, {
|
|
21208
|
+
default: vue.withCtx(() => [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(keys2), (key, i) => {
|
|
21209
|
+
return vue.withDirectives((vue.openBlock(), vue.createBlock(_component_van_field, {
|
|
21210
|
+
key: i,
|
|
21211
|
+
label: props.schema[key].label,
|
|
21212
|
+
required: props.schema[key].auth === "required",
|
|
21213
|
+
disabled: props.schema[key].auth === "readonly"
|
|
21214
|
+
}, {
|
|
21215
|
+
input: vue.withCtx(() => {
|
|
21216
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
21217
|
+
return [props.schema[key].type == "String" && !((_b = (_a = props.schema[key]) == null ? void 0 : _a.schema) == null ? void 0 : _b.options) ? (vue.openBlock(), vue.createBlock(_component_van_field, {
|
|
21218
|
+
key: 0,
|
|
21219
|
+
modelValue: data2.inputValue[key],
|
|
21220
|
+
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21221
|
+
placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
|
|
21222
|
+
type: "text"
|
|
21223
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : vue.createCommentVNode("", true), props.schema[key].type == "Number" && !((_d = (_c = props.schema[key]) == null ? void 0 : _c.schema) == null ? void 0 : _d.options) ? (vue.openBlock(), vue.createBlock(_component_van_field, {
|
|
21224
|
+
key: 1,
|
|
21225
|
+
modelValue: data2.inputValue[key],
|
|
21226
|
+
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21227
|
+
modelModifiers: {
|
|
21228
|
+
number: true
|
|
21229
|
+
},
|
|
21230
|
+
placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
|
|
21231
|
+
type: "number"
|
|
21232
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : vue.createCommentVNode("", true), props.schema[key].type == "Boolean" ? (vue.openBlock(), vue.createBlock(_component_van_switch, {
|
|
21233
|
+
key: 2,
|
|
21234
|
+
modelValue: data2.inputValue[key],
|
|
21235
|
+
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event
|
|
21236
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : vue.createCommentVNode("", true), props.schema[key].type == "Datetime" ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
21237
|
+
key: 3,
|
|
21238
|
+
modelValue: data2.inputValue[key],
|
|
21239
|
+
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21240
|
+
placeholder: "\u9009\u62E9\u65F6\u95F4"
|
|
21241
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : vue.createCommentVNode("", true), ((_f = (_e = props.schema[key]) == null ? void 0 : _e.schema) == null ? void 0 : _f.options) ? (vue.openBlock(), vue.createBlock(DataSelector, {
|
|
21242
|
+
key: 4,
|
|
21243
|
+
modelValue: data2.inputValue[key],
|
|
21244
|
+
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21245
|
+
options: (_h = (_g = props.schema[key]) == null ? void 0 : _g.schema) == null ? void 0 : _h.options,
|
|
21246
|
+
placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
|
|
21247
|
+
columnsFieldNames: {
|
|
21248
|
+
text: (((_j = (_i = props.schema[key]) == null ? void 0 : _i.schema) == null ? void 0 : _j.options) || []).length > 0 ? Object.keys(props.schema[key].schema.options[0])[0] : "",
|
|
21249
|
+
value: (((_l = (_k = props.schema[key]) == null ? void 0 : _k.schema) == null ? void 0 : _l.options) || []).length > 0 ? Object.keys(props.schema[key].schema.options[0])[1] : ""
|
|
21250
|
+
},
|
|
21251
|
+
onSelect: ($event) => onChangeOption(key)
|
|
21252
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "options", "placeholder", "columnsFieldNames", "onSelect"])) : vue.createCommentVNode("", true), props.schema[key].type == "Array" && props.schema[key].auth != "gone" ? (vue.openBlock(), vue.createBlock(_component_ObjsEditor, {
|
|
21253
|
+
key: 5,
|
|
21254
|
+
modelValue: data2.inputValue[key],
|
|
21255
|
+
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21256
|
+
schema: props.schema[key].schema
|
|
21257
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "schema"])) : vue.createCommentVNode("", true)];
|
|
21258
|
+
}),
|
|
21259
|
+
_: 2
|
|
21260
|
+
}, 1032, ["label", "required", "disabled"])), [[vue.vShow, props.schema[key].auth != "gone"]]);
|
|
21261
|
+
}), 128)), vue.createElementVNode("div", _hoisted_5, [data2.isShowInput ? (vue.openBlock(), vue.createBlock(_component_van_button, {
|
|
21262
|
+
key: 0,
|
|
21263
|
+
onClick: onInputConfirm
|
|
21264
|
+
}, {
|
|
21265
|
+
default: vue.withCtx(() => [_hoisted_6]),
|
|
21266
|
+
_: 1
|
|
21267
|
+
})) : vue.createCommentVNode("", true), data2.isShowInput ? (vue.openBlock(), vue.createBlock(_component_van_button, {
|
|
21268
|
+
key: 1,
|
|
21269
|
+
onClick: onInputCancel
|
|
21270
|
+
}, {
|
|
21271
|
+
default: vue.withCtx(() => [_hoisted_7]),
|
|
21272
|
+
_: 1
|
|
21273
|
+
})) : vue.createCommentVNode("", true)])]),
|
|
21274
|
+
_: 1
|
|
21275
|
+
}, 8, ["model"])) : vue.createCommentVNode("", true)]);
|
|
21189
21276
|
}), 128)), !data2.isShowInput && props.auth != "readonly" && props.auth != "disabled" ? (vue.openBlock(), vue.createBlock(_component_van_icon, {
|
|
21190
21277
|
key: 0,
|
|
21191
21278
|
name: "plus",
|
|
21192
21279
|
onClick: onNewOption
|
|
21193
|
-
})) : vue.createCommentVNode("", true)
|
|
21194
|
-
key: 1,
|
|
21195
|
-
model: data2.inputValue
|
|
21196
|
-
}, {
|
|
21197
|
-
default: vue.withCtx(() => [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(keys2), (key, i) => {
|
|
21198
|
-
return vue.withDirectives((vue.openBlock(), vue.createBlock(_component_van_field, {
|
|
21199
|
-
key: i,
|
|
21200
|
-
label: props.schema[key].label,
|
|
21201
|
-
required: props.schema[key].auth === "required",
|
|
21202
|
-
disabled: props.schema[key].auth === "readonly"
|
|
21203
|
-
}, {
|
|
21204
|
-
input: vue.withCtx(() => {
|
|
21205
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
21206
|
-
return [props.schema[key].type == "String" && !((_b = (_a = props.schema[key]) == null ? void 0 : _a.schema) == null ? void 0 : _b.options) ? (vue.openBlock(), vue.createBlock(_component_van_field, {
|
|
21207
|
-
key: 0,
|
|
21208
|
-
modelValue: data2.inputValue[key],
|
|
21209
|
-
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21210
|
-
placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
|
|
21211
|
-
type: "text"
|
|
21212
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : vue.createCommentVNode("", true), props.schema[key].type == "Number" && !((_d = (_c = props.schema[key]) == null ? void 0 : _c.schema) == null ? void 0 : _d.options) ? (vue.openBlock(), vue.createBlock(_component_van_field, {
|
|
21213
|
-
key: 1,
|
|
21214
|
-
modelValue: data2.inputValue[key],
|
|
21215
|
-
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21216
|
-
modelModifiers: {
|
|
21217
|
-
number: true
|
|
21218
|
-
},
|
|
21219
|
-
placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
|
|
21220
|
-
type: "number"
|
|
21221
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : vue.createCommentVNode("", true), props.schema[key].type == "Boolean" ? (vue.openBlock(), vue.createBlock(_component_van_switch, {
|
|
21222
|
-
key: 2,
|
|
21223
|
-
modelValue: data2.inputValue[key],
|
|
21224
|
-
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event
|
|
21225
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : vue.createCommentVNode("", true), props.schema[key].type == "Datetime" ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
21226
|
-
key: 3,
|
|
21227
|
-
modelValue: data2.inputValue[key],
|
|
21228
|
-
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21229
|
-
placeholder: "\u9009\u62E9\u65F6\u95F4"
|
|
21230
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : vue.createCommentVNode("", true), ((_f = (_e = props.schema[key]) == null ? void 0 : _e.schema) == null ? void 0 : _f.options) ? (vue.openBlock(), vue.createBlock(DataSelector, {
|
|
21231
|
-
key: 4,
|
|
21232
|
-
modelValue: data2.inputValue[key],
|
|
21233
|
-
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21234
|
-
options: (_h = (_g = props.schema[key]) == null ? void 0 : _g.schema) == null ? void 0 : _h.options,
|
|
21235
|
-
placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
|
|
21236
|
-
columnsFieldNames: {
|
|
21237
|
-
text: (((_j = (_i = props.schema[key]) == null ? void 0 : _i.schema) == null ? void 0 : _j.options) || []).length > 0 ? Object.keys(props.schema[key].schema.options[0])[0] : "",
|
|
21238
|
-
value: (((_l = (_k = props.schema[key]) == null ? void 0 : _k.schema) == null ? void 0 : _l.options) || []).length > 0 ? Object.keys(props.schema[key].schema.options[0])[1] : ""
|
|
21239
|
-
},
|
|
21240
|
-
onSelect: ($event) => onChangeOption(key)
|
|
21241
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "options", "placeholder", "columnsFieldNames", "onSelect"])) : vue.createCommentVNode("", true), props.schema[key].type == "Array" && props.schema[key].auth != "gone" ? (vue.openBlock(), vue.createBlock(_component_ObjsEditor, {
|
|
21242
|
-
key: 5,
|
|
21243
|
-
modelValue: data2.inputValue[key],
|
|
21244
|
-
"onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
|
|
21245
|
-
schema: props.schema[key].schema
|
|
21246
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "schema"])) : vue.createCommentVNode("", true)];
|
|
21247
|
-
}),
|
|
21248
|
-
_: 2
|
|
21249
|
-
}, 1032, ["label", "required", "disabled"])), [[vue.vShow, props.schema[key].auth != "gone"]]);
|
|
21250
|
-
}), 128)), vue.createElementVNode("div", _hoisted_4, [data2.isShowInput ? (vue.openBlock(), vue.createBlock(_component_van_button, {
|
|
21251
|
-
key: 0,
|
|
21252
|
-
onClick: onInputConfirm,
|
|
21253
|
-
type: "primary",
|
|
21254
|
-
size: "mini"
|
|
21255
|
-
}, {
|
|
21256
|
-
default: vue.withCtx(() => [_hoisted_5]),
|
|
21257
|
-
_: 1
|
|
21258
|
-
})) : vue.createCommentVNode("", true), data2.isShowInput ? (vue.openBlock(), vue.createBlock(_component_van_button, {
|
|
21259
|
-
key: 1,
|
|
21260
|
-
onClick: onInputCancel,
|
|
21261
|
-
type: "primary",
|
|
21262
|
-
size: "mini"
|
|
21263
|
-
}, {
|
|
21264
|
-
default: vue.withCtx(() => [_hoisted_6]),
|
|
21265
|
-
_: 1
|
|
21266
|
-
})) : vue.createCommentVNode("", true)])]),
|
|
21267
|
-
_: 1
|
|
21268
|
-
}, 8, ["model"])) : vue.createCommentVNode("", true)]),
|
|
21280
|
+
})) : vue.createCommentVNode("", true)])]),
|
|
21269
21281
|
_: 1
|
|
21270
21282
|
}, 8, ["label", "disabled", "required", "placeholder"])) : vue.createCommentVNode("", true);
|
|
21271
21283
|
};
|
|
21272
21284
|
}
|
|
21273
21285
|
};
|
|
21274
|
-
var ObjsEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
21286
|
+
var ObjsEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-60c690c1"]]);
|
|
21275
21287
|
const secret_notify = () => {
|
|
21276
21288
|
showNotify({ type: "danger", message: "\u4E25\u683C\u6267\u884C\u4FE1\u606F\u4FDD\u5BC6\u8981\u6C42\uFF0C\u5207\u5B9E\u9632\u8303\u4F01\u4E1A\u6CC4\u5BC6\u98CE\u9669", duration: 3e3 });
|
|
21277
21289
|
};
|
package/package.json
CHANGED
|
@@ -2,69 +2,79 @@
|
|
|
2
2
|
<van-field :label="props.label" v-if="!isGone" :disabled="isDisabled" :required="isRequired"
|
|
3
3
|
:placeholder="props.placeholder">
|
|
4
4
|
<template #input>
|
|
5
|
-
<div class="
|
|
6
|
-
<div
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
<div
|
|
10
|
-
|
|
5
|
+
<div class="widget-box">
|
|
6
|
+
<div class="option" v-for="(item, index) in modelValue" :key="index">
|
|
7
|
+
<div v-if="index != data.selectIndex" style=" display: flex;align-items: center;">
|
|
8
|
+
<van-icon name="arrow-left" @click.stop="onForward(index)" />
|
|
9
|
+
<div style="padding: 5px 5px;">
|
|
10
|
+
<div v-for="(k, j) in visiableKeys" :key="j" style="padding:2px 2px;">
|
|
11
|
+
{{ `${key2name(k)}:${key2value(k, item)}` }}
|
|
12
|
+
</div>
|
|
11
13
|
</div>
|
|
12
|
-
</div>
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
<div style="display: flex;flex-direction:column;cursor: pointer;">
|
|
16
|
+
<van-icon name="edit"
|
|
17
|
+
v-if="props.schema.auth != 'readonly' && props.auth != 'readonly' && props.auth != 'disabled'"
|
|
18
|
+
@click.stop="onEdit(index)" />
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
<van-icon name="arrow" @click.stop="onBack(index)" style="margin:8px 0" />
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
<van-icon name="cross"
|
|
23
|
+
v-if="props.schema.auth != 'readonly' && props.auth != 'readonly' && props.auth != 'disabled'"
|
|
24
|
+
@click.stop="onDelete(index)" />
|
|
25
|
+
</div>
|
|
20
26
|
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<van-icon name="plus" v-if="!data.isShowInput && props.auth!='readonly' && props.auth!='disabled'" @click="onNewOption" />
|
|
25
|
-
|
|
26
|
-
<van-form v-if="data.isShowInput" :model="data.inputValue">
|
|
27
|
-
<van-field v-for="(key, i) in keys" :key="i" :label="props.schema[key].label"
|
|
28
|
-
v-show="props.schema[key].auth != 'gone'" :required="props.schema[key].auth === 'required'"
|
|
29
|
-
:disabled="props.schema[key].auth === 'readonly'">
|
|
30
|
-
|
|
31
|
-
<template #input>
|
|
32
|
-
<van-field v-if="props.schema[key].type == 'String' && !props.schema[key]?.schema?.options"
|
|
33
|
-
v-model="data.inputValue[key]" :placeholder="`请输入${key2name(key)}`" type="text" />
|
|
34
|
-
|
|
35
|
-
<van-field v-if="props.schema[key].type == 'Number' && !props.schema[key]?.schema?.options"
|
|
36
|
-
v-model.number="data.inputValue[key]" :placeholder="`请输入${key2name(key)}`" type="number" />
|
|
37
27
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
28
|
+
<van-form v-if="data.isShowInput && index == data.selectIndex" :model="data.inputValue">
|
|
29
|
+
<van-field v-for="(key, i) in keys" :key="i" :label="props.schema[key].label"
|
|
30
|
+
v-show="props.schema[key].auth != 'gone'" :required="props.schema[key].auth === 'required'"
|
|
31
|
+
:disabled="props.schema[key].auth === 'readonly'">
|
|
32
|
+
|
|
33
|
+
<template #input>
|
|
34
|
+
<van-field
|
|
35
|
+
v-if="props.schema[key].type == 'String' && !props.schema[key]?.schema?.options"
|
|
36
|
+
v-model="data.inputValue[key]" :placeholder="`请输入${key2name(key)}`" type="text" />
|
|
37
|
+
|
|
38
|
+
<van-field
|
|
39
|
+
v-if="props.schema[key].type == 'Number' && !props.schema[key]?.schema?.options"
|
|
40
|
+
v-model.number="data.inputValue[key]" :placeholder="`请输入${key2name(key)}`"
|
|
41
|
+
type="number" />
|
|
42
|
+
|
|
43
|
+
<van-switch v-if="props.schema[key].type == 'Boolean'" v-model="data.inputValue[key]" />
|
|
44
|
+
|
|
45
|
+
<DatetimePicker v-if="props.schema[key].type == 'Datetime'"
|
|
46
|
+
v-model="data.inputValue[key]" placeholder="选择时间" />
|
|
47
|
+
|
|
48
|
+
<DateSelector v-if="props.schema[key]?.schema?.options" v-model="data.inputValue[key]"
|
|
49
|
+
:options="props.schema[key]?.schema?.options" :placeholder="`请输入${key2name(key)}`"
|
|
50
|
+
:columnsFieldNames="{
|
|
51
|
+
text: (props.schema[key]?.schema?.options || []).length > 0 ? Object.keys(props.schema[key].schema.options[0])[0] : '',
|
|
52
|
+
value: (props.schema[key]?.schema?.options || []).length > 0 ? Object.keys(props.schema[key].schema.options[0])[1] : ''
|
|
53
|
+
}" @select="onChangeOption(key)" />
|
|
54
|
+
|
|
55
|
+
<ObjsEditor v-if="props.schema[key].type == 'Array' && props.schema[key].auth != 'gone'"
|
|
56
|
+
v-model="data.inputValue[key]" :schema="props.schema[key].schema" />
|
|
57
|
+
</template>
|
|
58
|
+
</van-field>
|
|
59
|
+
|
|
60
|
+
<div style="margin: 16px; display: flex;align-items: center;justify-content: center;">
|
|
61
|
+
<van-button v-if="data.isShowInput" @click="onInputConfirm"
|
|
62
|
+
>保存</van-button>
|
|
63
|
+
<van-button v-if="data.isShowInput" @click="onInputCancel"
|
|
64
|
+
>取消</van-button>
|
|
65
|
+
</div>
|
|
66
|
+
</van-form>
|
|
60
67
|
</div>
|
|
61
|
-
|
|
68
|
+
|
|
69
|
+
<van-icon name="plus" v-if="!data.isShowInput && props.auth != 'readonly' && props.auth != 'disabled'"
|
|
70
|
+
@click="onNewOption" />
|
|
71
|
+
</div>
|
|
62
72
|
</template>
|
|
63
73
|
</van-field>
|
|
64
74
|
</template>
|
|
65
75
|
|
|
66
76
|
<script setup>
|
|
67
|
-
import { nextTick, ref, onMounted, defineProps, defineEmits, reactive, computed } from 'vue'
|
|
77
|
+
import { nextTick, ref, onMounted, defineProps, defineEmits, reactive, computed ,watch} from 'vue'
|
|
68
78
|
import { useVModel } from '@vueuse/core'
|
|
69
79
|
import util from '@/util'
|
|
70
80
|
import DatetimePicker from './DatetimePicker/index.vue'
|
|
@@ -114,11 +124,20 @@ const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
|
114
124
|
const data = reactive({
|
|
115
125
|
inputValue: {},
|
|
116
126
|
isShowInput: false,
|
|
117
|
-
selectIndex: -1
|
|
127
|
+
selectIndex: -1,
|
|
128
|
+
oldModelValue:[]
|
|
118
129
|
})
|
|
119
130
|
const keys = Object.keys(props.schema)
|
|
120
131
|
const visiableKeys = keys.filter(k => props.schema[k].auth != 'gone')
|
|
121
132
|
|
|
133
|
+
watch(()=>JSON.stringify(modelValue.value),(n,o)=>{
|
|
134
|
+
data.oldModelValue = JSON.parse(JSON.stringify(modelValue.value))
|
|
135
|
+
},{
|
|
136
|
+
immediate:true
|
|
137
|
+
},{
|
|
138
|
+
deep:true
|
|
139
|
+
})
|
|
140
|
+
|
|
122
141
|
onMounted(() => {
|
|
123
142
|
init()
|
|
124
143
|
})
|
|
@@ -207,15 +226,18 @@ const key2value = (key, item) => {
|
|
|
207
226
|
}
|
|
208
227
|
|
|
209
228
|
const onEdit = (index) => {
|
|
210
|
-
data.isShowInput = true
|
|
211
229
|
data.selectIndex = index
|
|
212
|
-
data.inputValue = modelValue.value[data.selectIndex]
|
|
230
|
+
data.inputValue = JSON.parse(JSON.stringify(modelValue.value[data.selectIndex]))
|
|
231
|
+
data.isShowInput = true
|
|
213
232
|
}
|
|
214
233
|
|
|
215
234
|
const onNewOption = () => {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
235
|
+
let oldModelValue = JSON.parse(JSON.stringify(modelValue.value))
|
|
236
|
+
modelValue.value = [...modelValue.value, makeDefaultValue()]
|
|
237
|
+
nextTick(()=>{
|
|
238
|
+
data.oldModelValue = oldModelValue
|
|
239
|
+
onEdit(modelValue.value.length - 1)
|
|
240
|
+
})
|
|
219
241
|
}
|
|
220
242
|
|
|
221
243
|
const onInputConfirm = () => {
|
|
@@ -228,22 +250,23 @@ const onInputConfirm = () => {
|
|
|
228
250
|
if (!data.inputValue) {
|
|
229
251
|
data.isShowInput = false
|
|
230
252
|
data.inputValue = makeDefaultValue()
|
|
253
|
+
data.selectIndex = -1
|
|
254
|
+
modelValue.value = data.oldModelValue
|
|
231
255
|
return
|
|
232
256
|
}
|
|
233
257
|
|
|
234
|
-
|
|
235
|
-
modelValue.value.push(data.inputValue)
|
|
236
|
-
} else {
|
|
237
|
-
modelValue.value[data.selectIndex] = data.inputValue
|
|
238
|
-
}
|
|
258
|
+
modelValue.value[data.selectIndex] = data.inputValue
|
|
239
259
|
|
|
240
260
|
data.isShowInput = false
|
|
241
261
|
data.inputValue = makeDefaultValue()
|
|
262
|
+
data.selectIndex = -1
|
|
242
263
|
}
|
|
243
264
|
|
|
244
265
|
const onInputCancel = () => {
|
|
245
266
|
data.isShowInput = false
|
|
246
267
|
data.inputValue = makeDefaultValue()
|
|
268
|
+
data.selectIndex = -1
|
|
269
|
+
modelValue.value = data.oldModelValue
|
|
247
270
|
}
|
|
248
271
|
|
|
249
272
|
const onChangeOption = (key) => {
|
|
@@ -266,17 +289,17 @@ const onChangeOption = (key) => {
|
|
|
266
289
|
box-sizing: border-box;
|
|
267
290
|
height: 100%;
|
|
268
291
|
text-align: left;
|
|
292
|
+
}
|
|
269
293
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
294
|
+
.option {
|
|
295
|
+
margin: 0 8px 8px 0;
|
|
296
|
+
padding: 5px 5px;
|
|
297
|
+
border-radius: 6px;
|
|
298
|
+
border: 2px solid #e1e1e1;
|
|
299
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
|
300
|
+
color: #666;
|
|
301
|
+
display: inline-block;
|
|
302
|
+
position: relative;
|
|
280
303
|
}
|
|
281
304
|
|
|
282
305
|
:deep(.van-field__label) {
|