widget.qw 1.0.62 → 1.0.64

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 CHANGED
@@ -840,15 +840,22 @@
840
840
  }
841
841
  .widget .readonly-field[data-v-0c8e09c0] {
842
842
  margin: 4px 0;
843
- }.option[data-v-91e049d6] {
843
+ }.widget[data-v-9c2543e2] {
844
+ background: #fff;
845
+ box-sizing: border-box;
846
+ height: 100%;
847
+ text-align: left;
848
+ }
849
+ .option[data-v-9c2543e2] {
844
850
  margin: 0 8px 8px 0;
845
851
  padding: 5px 5px;
846
- border-radius: 4px;
847
- background-color: rgb(217, 236, 255);
848
- color: #409eff;
852
+ border-radius: 6px;
853
+ border: 2px solid #e1e1e1;
854
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
855
+ color: #666;
849
856
  display: inline-block;
850
857
  position: relative;
851
858
  }
852
- [data-v-91e049d6] .van-field__label {
859
+ [data-v-9c2543e2] .van-field__label {
853
860
  margin: auto;
854
861
  }
@@ -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$6 = {
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$6, [props.multiple ? (openBlock(), createBlock(_component_van_checkbox_group, {
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$5 = /* @__PURE__ */ createTextVNode(" \u786E\u5B9A ");
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$5]),
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$4 = /* @__PURE__ */ createTextVNode("\u6E05\u7A7A");
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$4]),
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$3 = /* @__PURE__ */ createTextVNode("\u786E\u5B9A");
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$3]),
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$2 = /* @__PURE__ */ createTextVNode("\u786E\u5B9A");
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$2]),
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$1 = /* @__PURE__ */ createTextVNode(" \u6CE8\u9500 ");
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$1]),
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__ */ (() => ".option[data-v-91e049d6] {\n margin: 0 8px 8px 0;\n padding: 5px 5px;\n border-radius: 4px;\n background-color: rgb(217, 236, 255);\n color: #409eff;\n display: inline-block;\n position: relative;\n}\n[data-v-91e049d6] .van-field__label {\n margin: auto;\n}")();
20949
+ var ObjsEditor_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-9c2543e2] {\n background: #fff;\n box-sizing: border-box;\n height: 100%;\n text-align: left;\n}\n.option[data-v-9c2543e2] {\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-9c2543e2] .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 _hoisted_2 = {
20960
+ const _hoisted_3 = {
20957
20961
  style: {
20958
20962
  "padding": "5px 5px"
20959
20963
  }
20960
20964
  };
20961
- const _hoisted_3 = {
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 _hoisted_4 = {
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 _hoisted_5 = /* @__PURE__ */ createTextVNode("\u4FDD\u5B58");
20977
- const _hoisted_6 = /* @__PURE__ */ createTextVNode("\u53D6\u6D88");
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,18 +21031,22 @@ 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
+ if (!modelValue.value)
21041
+ modelValue.value = [];
21042
+ data2.oldModelValue = JSON.parse(JSON.stringify(modelValue.value));
21043
+ }, {
21044
+ immediate: true
21045
+ }, {
21046
+ deep: true
21047
+ });
21034
21048
  onMounted(() => {
21035
- init();
21036
21049
  });
21037
- const init = () => {
21038
- if (modelValue.value)
21039
- return;
21040
- modelValue.value = [];
21041
- };
21042
21050
  const makeDefaultValue = () => {
21043
21051
  let res = {};
21044
21052
  keys2.forEach((key) => {
@@ -21097,14 +21105,17 @@ const _sfc_main = {
21097
21105
  }
21098
21106
  };
21099
21107
  const onEdit = (index) => {
21100
- data2.isShowInput = true;
21101
21108
  data2.selectIndex = index;
21102
- data2.inputValue = modelValue.value[data2.selectIndex];
21109
+ data2.inputValue = JSON.parse(JSON.stringify(modelValue.value[data2.selectIndex]));
21110
+ data2.isShowInput = true;
21103
21111
  };
21104
21112
  const onNewOption = () => {
21105
- data2.selectIndex = -1;
21106
- data2.inputValue = makeDefaultValue();
21107
- data2.isShowInput = true;
21113
+ let oldModelValue = JSON.parse(JSON.stringify(modelValue.value));
21114
+ modelValue.value = [...modelValue.value || [], makeDefaultValue()];
21115
+ nextTick(() => {
21116
+ data2.oldModelValue = oldModelValue;
21117
+ onEdit(modelValue.value.length - 1);
21118
+ });
21108
21119
  };
21109
21120
  const onInputConfirm = () => {
21110
21121
  let idx = modelValue.value.indexOf((item) => JSON.stringify(item) === JSON.stringify(data2.inputValue));
@@ -21115,19 +21126,20 @@ const _sfc_main = {
21115
21126
  if (!data2.inputValue) {
21116
21127
  data2.isShowInput = false;
21117
21128
  data2.inputValue = makeDefaultValue();
21129
+ data2.selectIndex = -1;
21130
+ modelValue.value = data2.oldModelValue;
21118
21131
  return;
21119
21132
  }
21120
- if (data2.selectIndex < 0) {
21121
- modelValue.value.push(data2.inputValue);
21122
- } else {
21123
- modelValue.value[data2.selectIndex] = data2.inputValue;
21124
- }
21133
+ modelValue.value[data2.selectIndex] = data2.inputValue;
21125
21134
  data2.isShowInput = false;
21126
21135
  data2.inputValue = makeDefaultValue();
21136
+ data2.selectIndex = -1;
21127
21137
  };
21128
21138
  const onInputCancel = () => {
21129
21139
  data2.isShowInput = false;
21130
21140
  data2.inputValue = makeDefaultValue();
21141
+ data2.selectIndex = -1;
21142
+ modelValue.value = data2.oldModelValue;
21131
21143
  };
21132
21144
  const onChangeOption = (key) => {
21133
21145
  var _a, _b;
@@ -21154,21 +21166,21 @@ const _sfc_main = {
21154
21166
  required: unref(isRequired),
21155
21167
  placeholder: props.placeholder
21156
21168
  }, {
21157
- input: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(modelValue), (item, index) => {
21169
+ input: withCtx(() => [createElementVNode("div", _hoisted_1, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(modelValue), (item, index) => {
21158
21170
  return openBlock(), createElementBlock("div", {
21159
21171
  class: "option",
21160
21172
  key: index
21161
- }, [createElementVNode("div", _hoisted_1, [createVNode(_component_van_icon, {
21173
+ }, [index != data2.selectIndex ? (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(_component_van_icon, {
21162
21174
  name: "arrow-left",
21163
21175
  onClick: withModifiers(($event) => onForward(index), ["stop"])
21164
- }, null, 8, ["onClick"]), createElementVNode("div", _hoisted_2, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(visiableKeys), (k, j) => {
21176
+ }, null, 8, ["onClick"]), createElementVNode("div", _hoisted_3, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(visiableKeys), (k, j) => {
21165
21177
  return openBlock(), createElementBlock("div", {
21166
21178
  key: j,
21167
21179
  style: {
21168
21180
  "padding": "2px 2px"
21169
21181
  }
21170
21182
  }, toDisplayString(`${key2name(k)}:${key2value(k, item)}`), 1);
21171
- }), 128))]), createElementVNode("div", _hoisted_3, [props.schema.auth != "readonly" && props.auth != "readonly" && props.auth != "disabled" ? (openBlock(), createBlock(_component_van_icon, {
21183
+ }), 128))]), createElementVNode("div", _hoisted_4, [props.schema.auth != "readonly" && props.auth != "readonly" && props.auth != "disabled" ? (openBlock(), createBlock(_component_van_icon, {
21172
21184
  key: 0,
21173
21185
  name: "edit",
21174
21186
  onClick: withModifiers(($event) => onEdit(index), ["stop"])
@@ -21182,93 +21194,89 @@ const _sfc_main = {
21182
21194
  key: 1,
21183
21195
  name: "cross",
21184
21196
  onClick: withModifiers(($event) => onDelete(index), ["stop"])
21185
- }, null, 8, ["onClick"])) : createCommentVNode("", true)])])]);
21197
+ }, null, 8, ["onClick"])) : createCommentVNode("", true)])])) : createCommentVNode("", true), data2.isShowInput && index == data2.selectIndex ? (openBlock(), createBlock(_component_van_form, {
21198
+ key: 1,
21199
+ model: data2.inputValue
21200
+ }, {
21201
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(keys2), (key, i) => {
21202
+ return withDirectives((openBlock(), createBlock(_component_van_field, {
21203
+ key: i,
21204
+ label: props.schema[key].label,
21205
+ required: props.schema[key].auth === "required",
21206
+ disabled: props.schema[key].auth === "readonly"
21207
+ }, {
21208
+ input: withCtx(() => {
21209
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
21210
+ 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, {
21211
+ key: 0,
21212
+ modelValue: data2.inputValue[key],
21213
+ "onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
21214
+ placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
21215
+ type: "text"
21216
+ }, 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, {
21217
+ key: 1,
21218
+ modelValue: data2.inputValue[key],
21219
+ "onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
21220
+ modelModifiers: {
21221
+ number: true
21222
+ },
21223
+ placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
21224
+ type: "number"
21225
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : createCommentVNode("", true), props.schema[key].type == "Boolean" ? (openBlock(), createBlock(_component_van_switch, {
21226
+ key: 2,
21227
+ modelValue: data2.inputValue[key],
21228
+ "onUpdate:modelValue": ($event) => data2.inputValue[key] = $event
21229
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("", true), props.schema[key].type == "Datetime" ? (openBlock(), createBlock(_sfc_main$o, {
21230
+ key: 3,
21231
+ modelValue: data2.inputValue[key],
21232
+ "onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
21233
+ placeholder: "\u9009\u62E9\u65F6\u95F4"
21234
+ }, 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, {
21235
+ key: 4,
21236
+ modelValue: data2.inputValue[key],
21237
+ "onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
21238
+ options: (_h = (_g = props.schema[key]) == null ? void 0 : _g.schema) == null ? void 0 : _h.options,
21239
+ placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
21240
+ columnsFieldNames: {
21241
+ 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] : "",
21242
+ 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] : ""
21243
+ },
21244
+ onSelect: ($event) => onChangeOption(key)
21245
+ }, 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, {
21246
+ key: 5,
21247
+ modelValue: data2.inputValue[key],
21248
+ "onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
21249
+ schema: props.schema[key].schema
21250
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "schema"])) : createCommentVNode("", true)];
21251
+ }),
21252
+ _: 2
21253
+ }, 1032, ["label", "required", "disabled"])), [[vShow, props.schema[key].auth != "gone"]]);
21254
+ }), 128)), createElementVNode("div", _hoisted_5, [data2.isShowInput ? (openBlock(), createBlock(_component_van_button, {
21255
+ key: 0,
21256
+ onClick: onInputConfirm
21257
+ }, {
21258
+ default: withCtx(() => [_hoisted_6]),
21259
+ _: 1
21260
+ })) : createCommentVNode("", true), data2.isShowInput ? (openBlock(), createBlock(_component_van_button, {
21261
+ key: 1,
21262
+ onClick: onInputCancel
21263
+ }, {
21264
+ default: withCtx(() => [_hoisted_7]),
21265
+ _: 1
21266
+ })) : createCommentVNode("", true)])]),
21267
+ _: 1
21268
+ }, 8, ["model"])) : createCommentVNode("", true)]);
21186
21269
  }), 128)), !data2.isShowInput && props.auth != "readonly" && props.auth != "disabled" ? (openBlock(), createBlock(_component_van_icon, {
21187
21270
  key: 0,
21188
21271
  name: "plus",
21189
21272
  onClick: onNewOption
21190
- })) : createCommentVNode("", true), data2.isShowInput ? (openBlock(), createBlock(_component_van_form, {
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)]),
21273
+ })) : createCommentVNode("", true)])]),
21266
21274
  _: 1
21267
21275
  }, 8, ["label", "disabled", "required", "placeholder"])) : createCommentVNode("", true);
21268
21276
  };
21269
21277
  }
21270
21278
  };
21271
- var ObjsEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-91e049d6"]]);
21279
+ var ObjsEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9c2543e2"]]);
21272
21280
  const secret_notify = () => {
21273
21281
  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
21282
  };
@@ -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$6 = {
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$6, [props.multiple ? (vue.openBlock(), vue.createBlock(_component_van_checkbox_group, {
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$5 = /* @__PURE__ */ vue.createTextVNode(" \u786E\u5B9A ");
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$5]),
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$4 = /* @__PURE__ */ vue.createTextVNode("\u6E05\u7A7A");
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$4]),
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$3 = /* @__PURE__ */ vue.createTextVNode("\u786E\u5B9A");
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$3]),
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$2 = /* @__PURE__ */ vue.createTextVNode("\u786E\u5B9A");
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$2]),
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$1 = /* @__PURE__ */ vue.createTextVNode(" \u6CE8\u9500 ");
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$1]),
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__ */ (() => ".option[data-v-91e049d6] {\n margin: 0 8px 8px 0;\n padding: 5px 5px;\n border-radius: 4px;\n background-color: rgb(217, 236, 255);\n color: #409eff;\n display: inline-block;\n position: relative;\n}\n[data-v-91e049d6] .van-field__label {\n margin: auto;\n}")();
20952
+ var ObjsEditor_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-9c2543e2] {\n background: #fff;\n box-sizing: border-box;\n height: 100%;\n text-align: left;\n}\n.option[data-v-9c2543e2] {\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-9c2543e2] .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 _hoisted_2 = {
20963
+ const _hoisted_3 = {
20960
20964
  style: {
20961
20965
  "padding": "5px 5px"
20962
20966
  }
20963
20967
  };
20964
- const _hoisted_3 = {
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 _hoisted_4 = {
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 _hoisted_5 = /* @__PURE__ */ vue.createTextVNode("\u4FDD\u5B58");
20980
- const _hoisted_6 = /* @__PURE__ */ vue.createTextVNode("\u53D6\u6D88");
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,18 +21034,22 @@ 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
+ if (!modelValue.value)
21044
+ modelValue.value = [];
21045
+ data2.oldModelValue = JSON.parse(JSON.stringify(modelValue.value));
21046
+ }, {
21047
+ immediate: true
21048
+ }, {
21049
+ deep: true
21050
+ });
21037
21051
  vue.onMounted(() => {
21038
- init();
21039
21052
  });
21040
- const init = () => {
21041
- if (modelValue.value)
21042
- return;
21043
- modelValue.value = [];
21044
- };
21045
21053
  const makeDefaultValue = () => {
21046
21054
  let res = {};
21047
21055
  keys2.forEach((key) => {
@@ -21100,14 +21108,17 @@ var __async = (__this, __arguments, generator) => {
21100
21108
  }
21101
21109
  };
21102
21110
  const onEdit = (index) => {
21103
- data2.isShowInput = true;
21104
21111
  data2.selectIndex = index;
21105
- data2.inputValue = modelValue.value[data2.selectIndex];
21112
+ data2.inputValue = JSON.parse(JSON.stringify(modelValue.value[data2.selectIndex]));
21113
+ data2.isShowInput = true;
21106
21114
  };
21107
21115
  const onNewOption = () => {
21108
- data2.selectIndex = -1;
21109
- data2.inputValue = makeDefaultValue();
21110
- data2.isShowInput = true;
21116
+ let oldModelValue = JSON.parse(JSON.stringify(modelValue.value));
21117
+ modelValue.value = [...modelValue.value || [], makeDefaultValue()];
21118
+ vue.nextTick(() => {
21119
+ data2.oldModelValue = oldModelValue;
21120
+ onEdit(modelValue.value.length - 1);
21121
+ });
21111
21122
  };
21112
21123
  const onInputConfirm = () => {
21113
21124
  let idx = modelValue.value.indexOf((item) => JSON.stringify(item) === JSON.stringify(data2.inputValue));
@@ -21118,19 +21129,20 @@ var __async = (__this, __arguments, generator) => {
21118
21129
  if (!data2.inputValue) {
21119
21130
  data2.isShowInput = false;
21120
21131
  data2.inputValue = makeDefaultValue();
21132
+ data2.selectIndex = -1;
21133
+ modelValue.value = data2.oldModelValue;
21121
21134
  return;
21122
21135
  }
21123
- if (data2.selectIndex < 0) {
21124
- modelValue.value.push(data2.inputValue);
21125
- } else {
21126
- modelValue.value[data2.selectIndex] = data2.inputValue;
21127
- }
21136
+ modelValue.value[data2.selectIndex] = data2.inputValue;
21128
21137
  data2.isShowInput = false;
21129
21138
  data2.inputValue = makeDefaultValue();
21139
+ data2.selectIndex = -1;
21130
21140
  };
21131
21141
  const onInputCancel = () => {
21132
21142
  data2.isShowInput = false;
21133
21143
  data2.inputValue = makeDefaultValue();
21144
+ data2.selectIndex = -1;
21145
+ modelValue.value = data2.oldModelValue;
21134
21146
  };
21135
21147
  const onChangeOption = (key) => {
21136
21148
  var _a, _b;
@@ -21157,21 +21169,21 @@ var __async = (__this, __arguments, generator) => {
21157
21169
  required: vue.unref(isRequired),
21158
21170
  placeholder: props.placeholder
21159
21171
  }, {
21160
- input: vue.withCtx(() => [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(modelValue), (item, index) => {
21172
+ input: vue.withCtx(() => [vue.createElementVNode("div", _hoisted_1, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(modelValue), (item, index) => {
21161
21173
  return vue.openBlock(), vue.createElementBlock("div", {
21162
21174
  class: "option",
21163
21175
  key: index
21164
- }, [vue.createElementVNode("div", _hoisted_1, [vue.createVNode(_component_van_icon, {
21176
+ }, [index != data2.selectIndex ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [vue.createVNode(_component_van_icon, {
21165
21177
  name: "arrow-left",
21166
21178
  onClick: vue.withModifiers(($event) => onForward(index), ["stop"])
21167
- }, null, 8, ["onClick"]), vue.createElementVNode("div", _hoisted_2, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(visiableKeys), (k, j) => {
21179
+ }, null, 8, ["onClick"]), vue.createElementVNode("div", _hoisted_3, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(visiableKeys), (k, j) => {
21168
21180
  return vue.openBlock(), vue.createElementBlock("div", {
21169
21181
  key: j,
21170
21182
  style: {
21171
21183
  "padding": "2px 2px"
21172
21184
  }
21173
21185
  }, vue.toDisplayString(`${key2name(k)}:${key2value(k, item)}`), 1);
21174
- }), 128))]), vue.createElementVNode("div", _hoisted_3, [props.schema.auth != "readonly" && props.auth != "readonly" && props.auth != "disabled" ? (vue.openBlock(), vue.createBlock(_component_van_icon, {
21186
+ }), 128))]), vue.createElementVNode("div", _hoisted_4, [props.schema.auth != "readonly" && props.auth != "readonly" && props.auth != "disabled" ? (vue.openBlock(), vue.createBlock(_component_van_icon, {
21175
21187
  key: 0,
21176
21188
  name: "edit",
21177
21189
  onClick: vue.withModifiers(($event) => onEdit(index), ["stop"])
@@ -21185,93 +21197,89 @@ var __async = (__this, __arguments, generator) => {
21185
21197
  key: 1,
21186
21198
  name: "cross",
21187
21199
  onClick: vue.withModifiers(($event) => onDelete(index), ["stop"])
21188
- }, null, 8, ["onClick"])) : vue.createCommentVNode("", true)])])]);
21200
+ }, null, 8, ["onClick"])) : vue.createCommentVNode("", true)])])) : vue.createCommentVNode("", true), data2.isShowInput && index == data2.selectIndex ? (vue.openBlock(), vue.createBlock(_component_van_form, {
21201
+ key: 1,
21202
+ model: data2.inputValue
21203
+ }, {
21204
+ default: vue.withCtx(() => [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(keys2), (key, i) => {
21205
+ return vue.withDirectives((vue.openBlock(), vue.createBlock(_component_van_field, {
21206
+ key: i,
21207
+ label: props.schema[key].label,
21208
+ required: props.schema[key].auth === "required",
21209
+ disabled: props.schema[key].auth === "readonly"
21210
+ }, {
21211
+ input: vue.withCtx(() => {
21212
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
21213
+ 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, {
21214
+ key: 0,
21215
+ modelValue: data2.inputValue[key],
21216
+ "onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
21217
+ placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
21218
+ type: "text"
21219
+ }, 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, {
21220
+ key: 1,
21221
+ modelValue: data2.inputValue[key],
21222
+ "onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
21223
+ modelModifiers: {
21224
+ number: true
21225
+ },
21226
+ placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
21227
+ type: "number"
21228
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : vue.createCommentVNode("", true), props.schema[key].type == "Boolean" ? (vue.openBlock(), vue.createBlock(_component_van_switch, {
21229
+ key: 2,
21230
+ modelValue: data2.inputValue[key],
21231
+ "onUpdate:modelValue": ($event) => data2.inputValue[key] = $event
21232
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])) : vue.createCommentVNode("", true), props.schema[key].type == "Datetime" ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
21233
+ key: 3,
21234
+ modelValue: data2.inputValue[key],
21235
+ "onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
21236
+ placeholder: "\u9009\u62E9\u65F6\u95F4"
21237
+ }, 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, {
21238
+ key: 4,
21239
+ modelValue: data2.inputValue[key],
21240
+ "onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
21241
+ options: (_h = (_g = props.schema[key]) == null ? void 0 : _g.schema) == null ? void 0 : _h.options,
21242
+ placeholder: `\u8BF7\u8F93\u5165${key2name(key)}`,
21243
+ columnsFieldNames: {
21244
+ 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] : "",
21245
+ 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] : ""
21246
+ },
21247
+ onSelect: ($event) => onChangeOption(key)
21248
+ }, 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, {
21249
+ key: 5,
21250
+ modelValue: data2.inputValue[key],
21251
+ "onUpdate:modelValue": ($event) => data2.inputValue[key] = $event,
21252
+ schema: props.schema[key].schema
21253
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "schema"])) : vue.createCommentVNode("", true)];
21254
+ }),
21255
+ _: 2
21256
+ }, 1032, ["label", "required", "disabled"])), [[vue.vShow, props.schema[key].auth != "gone"]]);
21257
+ }), 128)), vue.createElementVNode("div", _hoisted_5, [data2.isShowInput ? (vue.openBlock(), vue.createBlock(_component_van_button, {
21258
+ key: 0,
21259
+ onClick: onInputConfirm
21260
+ }, {
21261
+ default: vue.withCtx(() => [_hoisted_6]),
21262
+ _: 1
21263
+ })) : vue.createCommentVNode("", true), data2.isShowInput ? (vue.openBlock(), vue.createBlock(_component_van_button, {
21264
+ key: 1,
21265
+ onClick: onInputCancel
21266
+ }, {
21267
+ default: vue.withCtx(() => [_hoisted_7]),
21268
+ _: 1
21269
+ })) : vue.createCommentVNode("", true)])]),
21270
+ _: 1
21271
+ }, 8, ["model"])) : vue.createCommentVNode("", true)]);
21189
21272
  }), 128)), !data2.isShowInput && props.auth != "readonly" && props.auth != "disabled" ? (vue.openBlock(), vue.createBlock(_component_van_icon, {
21190
21273
  key: 0,
21191
21274
  name: "plus",
21192
21275
  onClick: onNewOption
21193
- })) : vue.createCommentVNode("", true), data2.isShowInput ? (vue.openBlock(), vue.createBlock(_component_van_form, {
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)]),
21276
+ })) : vue.createCommentVNode("", true)])]),
21269
21277
  _: 1
21270
21278
  }, 8, ["label", "disabled", "required", "placeholder"])) : vue.createCommentVNode("", true);
21271
21279
  };
21272
21280
  }
21273
21281
  };
21274
- var ObjsEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-91e049d6"]]);
21282
+ var ObjsEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9c2543e2"]]);
21275
21283
  const secret_notify = () => {
21276
21284
  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
21285
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "widget.qw",
3
3
  "private": false,
4
- "version": "1.0.62",
4
+ "version": "1.0.64",
5
5
  "description": "marqstree Vue3组件库",
6
6
  "main": "build/widget.qw.es.js",
7
7
  "keywords": [
@@ -2,74 +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="option" v-for="(item, index) in modelValue" :key="index">
6
- <div style=" display: flex;align-items: center;">
7
- <van-icon name="arrow-left" @click.stop="onForward(index)" />
8
- <div style="padding: 5px 5px;">
9
- <div v-for="(k, j) in visiableKeys" :key="j" style="padding:2px 2px;">
10
- {{ `${key2name(k)}:${key2value(k, item)}` }}
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
- <div style="display: flex;flex-direction:column;cursor: pointer;">
15
- <van-icon name="edit"
16
- v-if="props.schema.auth != 'readonly' && props.auth != 'readonly' && props.auth != 'disabled'"
17
- @click.stop="onEdit(index)" />
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)" />
18
19
 
19
- <van-icon name="arrow" @click.stop="onBack(index)" style="margin:8px 0" />
20
+ <van-icon name="arrow" @click.stop="onBack(index)" style="margin:8px 0" />
20
21
 
21
- <van-icon name="cross"
22
- v-if="props.schema.auth != 'readonly' && props.auth != 'readonly' && props.auth != 'disabled'"
23
- @click.stop="onDelete(index)" />
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>
24
26
  </div>
25
- </div>
26
- </div>
27
-
28
- <van-icon name="plus" v-if="!data.isShowInput && props.auth != 'readonly' && props.auth != 'disabled'"
29
- @click="onNewOption" />
30
-
31
- <van-form v-if="data.isShowInput" :model="data.inputValue">
32
- <van-field v-for="(key, i) in keys" :key="i" :label="props.schema[key].label"
33
- v-show="props.schema[key].auth != 'gone'" :required="props.schema[key].auth === 'required'"
34
- :disabled="props.schema[key].auth === 'readonly'">
35
-
36
- <template #input>
37
- <van-field v-if="props.schema[key].type == 'String' && !props.schema[key]?.schema?.options"
38
- v-model="data.inputValue[key]" :placeholder="`请输入${key2name(key)}`" type="text" />
39
-
40
- <van-field v-if="props.schema[key].type == 'Number' && !props.schema[key]?.schema?.options"
41
- v-model.number="data.inputValue[key]" :placeholder="`请输入${key2name(key)}`" type="number" />
42
27
 
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'" v-model="data.inputValue[key]"
46
- 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" type="primary"
62
- size="mini">保存</van-button>
63
- <van-button v-if="data.isShowInput" @click="onInputCancel" type="primary"
64
- size="mini">取消</van-button>
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>
65
67
  </div>
66
- </van-form>
68
+
69
+ <van-icon name="plus" v-if="!data.isShowInput && props.auth != 'readonly' && props.auth != 'disabled'"
70
+ @click="onNewOption" />
71
+ </div>
67
72
  </template>
68
73
  </van-field>
69
74
  </template>
70
75
 
71
76
  <script setup>
72
- import { nextTick, ref, onMounted, defineProps, defineEmits, reactive, computed } from 'vue'
77
+ import { nextTick, ref, onMounted, defineProps, defineEmits, reactive, computed ,watch} from 'vue'
73
78
  import { useVModel } from '@vueuse/core'
74
79
  import util from '@/util'
75
80
  import DatetimePicker from './DatetimePicker/index.vue'
@@ -119,21 +124,25 @@ const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
119
124
  const data = reactive({
120
125
  inputValue: {},
121
126
  isShowInput: false,
122
- selectIndex: -1
127
+ selectIndex: -1,
128
+ oldModelValue:[]
123
129
  })
124
130
  const keys = Object.keys(props.schema)
125
131
  const visiableKeys = keys.filter(k => props.schema[k].auth != 'gone')
126
132
 
127
- onMounted(() => {
128
- init()
133
+ watch(()=>JSON.stringify(modelValue.value),(n,o)=>{
134
+ if(!modelValue.value)
135
+ modelValue.value = []
136
+
137
+ data.oldModelValue = JSON.parse(JSON.stringify(modelValue.value))
138
+ },{
139
+ immediate:true
140
+ },{
141
+ deep:true
129
142
  })
130
143
 
131
- const init = () => {
132
- if (modelValue.value)
133
- return
134
-
135
- modelValue.value = []
136
- }
144
+ onMounted(() => {
145
+ })
137
146
 
138
147
  const makeDefaultValue = () => {
139
148
  let res = {}
@@ -212,15 +221,18 @@ const key2value = (key, item) => {
212
221
  }
213
222
 
214
223
  const onEdit = (index) => {
215
- data.isShowInput = true
216
224
  data.selectIndex = index
217
- data.inputValue = modelValue.value[data.selectIndex]
225
+ data.inputValue = JSON.parse(JSON.stringify(modelValue.value[data.selectIndex]))
226
+ data.isShowInput = true
218
227
  }
219
228
 
220
229
  const onNewOption = () => {
221
- data.selectIndex = -1
222
- data.inputValue = makeDefaultValue()
223
- data.isShowInput = true
230
+ let oldModelValue = JSON.parse(JSON.stringify(modelValue.value))
231
+ modelValue.value = [...(modelValue.value || []), makeDefaultValue()]
232
+ nextTick(()=>{
233
+ data.oldModelValue = oldModelValue
234
+ onEdit(modelValue.value.length - 1)
235
+ })
224
236
  }
225
237
 
226
238
  const onInputConfirm = () => {
@@ -233,22 +245,23 @@ const onInputConfirm = () => {
233
245
  if (!data.inputValue) {
234
246
  data.isShowInput = false
235
247
  data.inputValue = makeDefaultValue()
248
+ data.selectIndex = -1
249
+ modelValue.value = data.oldModelValue
236
250
  return
237
251
  }
238
252
 
239
- if (data.selectIndex < 0) {
240
- modelValue.value.push(data.inputValue)
241
- } else {
242
- modelValue.value[data.selectIndex] = data.inputValue
243
- }
253
+ modelValue.value[data.selectIndex] = data.inputValue
244
254
 
245
255
  data.isShowInput = false
246
256
  data.inputValue = makeDefaultValue()
257
+ data.selectIndex = -1
247
258
  }
248
259
 
249
260
  const onInputCancel = () => {
250
261
  data.isShowInput = false
251
262
  data.inputValue = makeDefaultValue()
263
+ data.selectIndex = -1
264
+ modelValue.value = data.oldModelValue
252
265
  }
253
266
 
254
267
  const onChangeOption = (key) => {
@@ -266,12 +279,20 @@ const onChangeOption = (key) => {
266
279
  </script>
267
280
 
268
281
  <style lang="scss" scoped>
282
+ .widget {
283
+ background: #fff;
284
+ box-sizing: border-box;
285
+ height: 100%;
286
+ text-align: left;
287
+ }
288
+
269
289
  .option {
270
290
  margin: 0 8px 8px 0;
271
291
  padding: 5px 5px;
272
- border-radius: 4px;
273
- background-color: rgb(217, 236, 255);
274
- color: #409eff;
292
+ border-radius: 6px;
293
+ border: 2px solid #e1e1e1;
294
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
295
+ color: #666;
275
296
  display: inline-block;
276
297
  position: relative;
277
298
  }
@@ -247,7 +247,7 @@ const data = reactive({
247
247
  // }
248
248
  // }
249
249
  //},
250
- datas: [],
250
+ datas: null,
251
251
  })
252
252
 
253
253
  watch(() => data.datas, (n, o) => {