@yoooloo42/joker 1.0.110 → 1.0.112

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/dist/index.cjs.js CHANGED
@@ -23246,7 +23246,7 @@ return (_ctx, _cache) => {
23246
23246
  ]))
23247
23247
  : vue.createCommentVNode("v-if", true),
23248
23248
  vue.createCommentVNode(" 行政区划 "),
23249
- (vue.unref(propsItem_box).inputType === 'd3gbt2260')
23249
+ (vue.unref(propsItem_box).inputType === 'ly0gbt2260')
23250
23250
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_23, [
23251
23251
  vue.createVNode(_component_ly0gbt2260, {
23252
23252
  modelValue: vue.unref(formData_box)[vue.unref(propsItem_box).fieldName],
@@ -23256,7 +23256,7 @@ return (_ctx, _cache) => {
23256
23256
  ]))
23257
23257
  : vue.createCommentVNode("v-if", true),
23258
23258
  vue.createCommentVNode(" 商品分类 "),
23259
- (vue.unref(propsItem_box).inputType === 'd7group')
23259
+ (vue.unref(propsItem_box).inputType === 'ly0d7group')
23260
23260
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_24, [
23261
23261
  vue.createVNode(_component_ly0d7group, {
23262
23262
  modelValue: vue.unref(formData_box)[vue.unref(propsItem_box).fieldName],
@@ -23266,7 +23266,7 @@ return (_ctx, _cache) => {
23266
23266
  ]))
23267
23267
  : vue.createCommentVNode("v-if", true),
23268
23268
  vue.createCommentVNode(" 邮寄地址 "),
23269
- (vue.unref(propsItem_box).inputType === 'd7postal')
23269
+ (vue.unref(propsItem_box).inputType === 'ly0d7postal')
23270
23270
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_25, [
23271
23271
  vue.createVNode(_component_ly0d7postal, {
23272
23272
  modelValue: vue.unref(formData_box)[vue.unref(propsItem_box).fieldName],
@@ -23276,7 +23276,7 @@ return (_ctx, _cache) => {
23276
23276
  ]))
23277
23277
  : vue.createCommentVNode("v-if", true),
23278
23278
  vue.createCommentVNode(" 商品标价 "),
23279
- (vue.unref(propsItem_box).inputType === 'd7price')
23279
+ (vue.unref(propsItem_box).inputType === 'ly0d7price')
23280
23280
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_26, [
23281
23281
  vue.createVNode(_component_ly0d7price, {
23282
23282
  modelValue: vue.unref(formData_box)[vue.unref(propsItem_box).fieldName],
@@ -23286,7 +23286,7 @@ return (_ctx, _cache) => {
23286
23286
  ]))
23287
23287
  : vue.createCommentVNode("v-if", true),
23288
23288
  vue.createCommentVNode(" 商品规格 "),
23289
- (vue.unref(propsItem_box).inputType === 'd7size')
23289
+ (vue.unref(propsItem_box).inputType === 'ly0d7size')
23290
23290
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_27, [
23291
23291
  vue.createVNode(_component_ly0d7size, {
23292
23292
  modelValue: vue.unref(formData_box)[vue.unref(propsItem_box).fieldName],
@@ -23296,7 +23296,7 @@ return (_ctx, _cache) => {
23296
23296
  ]))
23297
23297
  : vue.createCommentVNode("v-if", true),
23298
23298
  vue.createCommentVNode(" 商品缩略图 "),
23299
- (vue.unref(propsItem_box).inputType === 'd7thumb')
23299
+ (vue.unref(propsItem_box).inputType === 'ly0d7thumb')
23300
23300
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_28, [
23301
23301
  vue.createVNode(_component_ly0d7thumb, {
23302
23302
  modelValue: vue.unref(formData_box),
@@ -41999,69 +41999,70 @@ vue.watch(() => props.modelValue,
41999
41999
 
42000
42000
  // 确保按顺序加载级联数据
42001
42001
  if (modelValue_box.code2) {
42002
- await hdlChangeCode2(modelValue_box.code2);
42002
+ await hdl.changeCode2(modelValue_box.code2);
42003
42003
  }
42004
42004
  if (modelValue_box.code4) {
42005
- await hdlChangeCode4(modelValue_box.code4);
42005
+ await hdl.changeCode4(modelValue_box.code4);
42006
42006
  }
42007
42007
  }
42008
42008
  },
42009
42009
  { immediate: true }
42010
42010
  );
42011
42011
 
42012
- const hdlPopup = async () => {
42013
- if (props.myProps.readOnly) {
42014
- return
42015
- }
42016
-
42017
- popup.formData.code2 = modelValue_box.code2;
42018
- await hdlChangeCode2(popup.formData.code2);
42019
-
42020
- popup.formData.code4 = modelValue_box.code4;
42021
- await hdlChangeCode4(popup.formData.code4);
42012
+ const hdl = {
42013
+ popup: async () => {
42014
+ if (props.myProps.readOnly) {
42015
+ return
42016
+ }
42017
+
42018
+ popup.formData.code2 = modelValue_box.code2;
42019
+ await hdl.changeCode2(popup.formData.code2);
42020
+
42021
+ popup.formData.code4 = modelValue_box.code4;
42022
+ await hdl.changeCode4(popup.formData.code4);
42023
+
42024
+ popup.formData.code6 = modelValue_box.code6;
42025
+ popup.visible = true;
42026
+ },
42022
42027
 
42023
- popup.formData.code6 = modelValue_box.code6;
42024
- popup.visible = true;
42025
- };
42026
-
42027
- const hdlChangeCode2 = async value => { // 使用 async 标记
42028
- const result = await request.ly0.storpro({
42029
- noSession: true,
42030
- storproName: 'ly0d3.gbt2260code4.code2',
42031
- data: {code2: value},
42032
- });
42028
+ changeCode2: async value => { // 使用 async 标记
42029
+ const result = await request.ly0.storpro({
42030
+ noSession: true,
42031
+ storproName: 'ly0d3.gbt2260code4.code2',
42032
+ data: {code2: value},
42033
+ });
42034
+
42035
+ popup.formData.arrCode4 = result.arrCode4.filter(item => item.code4);
42036
+ popup.formData.code4 = '';
42037
+ popup.formData.arrCode6 = [];
42038
+ popup.formData.code6 = '';
42039
+ },
42033
42040
 
42034
- popup.formData.arrCode4 = result.arrCode4.filter(item => item.code4);
42035
- popup.formData.code4 = '';
42036
- popup.formData.arrCode6 = [];
42037
- popup.formData.code6 = '';
42038
- };
42039
-
42040
- const hdlChangeCode4 = async value => {
42041
- const result = await request.ly0.storpro({
42042
- noSession: true,
42043
- storproName: 'ly0d3.gbt2260code6.code4',
42044
- data: {code4: value},
42045
- });
42041
+ changeCode4: async value => {
42042
+ const result = await request.ly0.storpro({
42043
+ noSession: true,
42044
+ storproName: 'ly0d3.gbt2260code6.code4',
42045
+ data: {code4: value},
42046
+ });
42047
+
42048
+ popup.formData.arrCode6 = result.arrCode6.filter(item => item.code6);
42049
+ popup.formData.code6 = '';
42050
+ },
42046
42051
 
42047
- popup.formData.arrCode6 = result.arrCode6.filter(item => item.code6);
42048
- popup.formData.code6 = '';
42049
- };
42050
-
42051
- const hdlSubmit = () => {
42052
- // ... (安全查找逻辑) ...
42053
- modelValue_box.code2 = popup.formData.code2;
42054
- const foundItem2 = popup.formData.arrCode2.find(i => i.code2 === modelValue_box.code2);
42055
- modelValue_box.text2 = foundItem2 ? foundItem2.text2 : '';
42056
- modelValue_box.code4 = popup.formData.code4;
42057
- const foundItem4 = popup.formData.arrCode4.find(i => i.code4 === modelValue_box.code4);
42058
- modelValue_box.text4 = foundItem4 ? foundItem4.text4 : '';
42059
- modelValue_box.code6 = popup.formData.code6;
42060
- const foundItem6 = popup.formData.arrCode6.find(i => i.code6 === modelValue_box.code6);
42061
- modelValue_box.text6 = foundItem6 ? foundItem6.text6 : '';
42062
- // 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
42063
- emit("update:modelValue", modelValue_box.code6 ?? modelValue_box.code4 ?? modelValue_box.code2 ?? '');
42064
- popup.visible = false;
42052
+ submit: () => {
42053
+ modelValue_box.code2 = popup.formData.code2;
42054
+ const foundItem2 = popup.formData.arrCode2.find(i => i.code2 === modelValue_box.code2);
42055
+ modelValue_box.text2 = foundItem2 ? foundItem2.text2 : '';
42056
+ modelValue_box.code4 = popup.formData.code4;
42057
+ const foundItem4 = popup.formData.arrCode4.find(i => i.code4 === modelValue_box.code4);
42058
+ modelValue_box.text4 = foundItem4 ? foundItem4.text4 : '';
42059
+ modelValue_box.code6 = popup.formData.code6;
42060
+ const foundItem6 = popup.formData.arrCode6.find(i => i.code6 === modelValue_box.code6);
42061
+ modelValue_box.text6 = foundItem6 ? foundItem6.text6 : '';
42062
+ // 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
42063
+ emit("update:modelValue", modelValue_box.code6 ?? modelValue_box.code4 ?? modelValue_box.code2 ?? '');
42064
+ popup.visible = false;
42065
+ }
42065
42066
  };
42066
42067
 
42067
42068
  const style = vue.reactive({
@@ -42107,7 +42108,9 @@ return (_ctx, _cache) => {
42107
42108
  const _component_el_button = vue.resolveComponent("el-button");
42108
42109
  const _component_el_dialog = vue.resolveComponent("el-dialog");
42109
42110
 
42110
- return (vue.openBlock(), vue.createElementBlock("div", { onClick: hdlPopup }, [
42111
+ return (vue.openBlock(), vue.createElementBlock("div", {
42112
+ onClick: _cache[4] || (_cache[4] = (...args) => (hdl.popup && hdl.popup(...args)))
42113
+ }, [
42111
42114
  vue.createElementVNode("table", null, [
42112
42115
  vue.createElementVNode("tbody", null, [
42113
42116
  vue.createElementVNode("tr", null, [
@@ -42136,7 +42139,7 @@ return (_ctx, _cache) => {
42136
42139
  ])
42137
42140
  ]),
42138
42141
  vue.createElementVNode("tr", null, [
42139
- _cache[4] || (_cache[4] = vue.createElementVNode("td", null, null, -1 /* CACHED */)),
42142
+ _cache[5] || (_cache[5] = vue.createElementVNode("td", null, null, -1 /* CACHED */)),
42140
42143
  vue.createElementVNode("td", null, [
42141
42144
  vue.createElementVNode("span", {
42142
42145
  style: vue.normalizeStyle(style.modelValue_box.code)
@@ -42149,7 +42152,7 @@ return (_ctx, _cache) => {
42149
42152
  ])
42150
42153
  ]),
42151
42154
  vue.createElementVNode("tr", null, [
42152
- _cache[5] || (_cache[5] = vue.createElementVNode("td", null, null, -1 /* CACHED */)),
42155
+ _cache[6] || (_cache[6] = vue.createElementVNode("td", null, null, -1 /* CACHED */)),
42153
42156
  vue.createElementVNode("td", null, [
42154
42157
  vue.createElementVNode("span", {
42155
42158
  style: vue.normalizeStyle(style.modelValue_box.code)
@@ -42189,7 +42192,7 @@ return (_ctx, _cache) => {
42189
42192
  placeholder: "请选择 省",
42190
42193
  filterable: "",
42191
42194
  style: vue.normalizeStyle(style.popup.select),
42192
- onChange: hdlChangeCode2
42195
+ onChange: hdl.changeCode2
42193
42196
  }, {
42194
42197
  default: vue.withCtx(() => [
42195
42198
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(popup.formData.arrCode2, (item, index) => {
@@ -42201,7 +42204,7 @@ return (_ctx, _cache) => {
42201
42204
  }), 128 /* KEYED_FRAGMENT */))
42202
42205
  ]),
42203
42206
  _: 1 /* STABLE */
42204
- }, 8 /* PROPS */, ["modelValue", "style"])
42207
+ }, 8 /* PROPS */, ["modelValue", "style", "onChange"])
42205
42208
  ])
42206
42209
  ]),
42207
42210
  vue.createElementVNode("tr", null, [
@@ -42217,7 +42220,7 @@ return (_ctx, _cache) => {
42217
42220
  placeholder: "请选择 市",
42218
42221
  filterable: "",
42219
42222
  style: vue.normalizeStyle(style.popup.select),
42220
- onChange: hdlChangeCode4
42223
+ onChange: hdl.changeCode4
42221
42224
  }, {
42222
42225
  default: vue.withCtx(() => [
42223
42226
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(popup.formData.arrCode4, (item, index) => {
@@ -42229,7 +42232,7 @@ return (_ctx, _cache) => {
42229
42232
  }), 128 /* KEYED_FRAGMENT */))
42230
42233
  ]),
42231
42234
  _: 1 /* STABLE */
42232
- }, 8 /* PROPS */, ["modelValue", "style"])
42235
+ }, 8 /* PROPS */, ["modelValue", "style", "onChange"])
42233
42236
  ])
42234
42237
  ]),
42235
42238
  vue.createElementVNode("tr", null, [
@@ -42270,13 +42273,13 @@ return (_ctx, _cache) => {
42270
42273
  vue.createVNode(_component_el_button, {
42271
42274
  type: "danger",
42272
42275
  plain: "",
42273
- onClick: hdlSubmit
42276
+ onClick: hdl.submit
42274
42277
  }, {
42275
- default: vue.withCtx(() => [...(_cache[6] || (_cache[6] = [
42278
+ default: vue.withCtx(() => [...(_cache[7] || (_cache[7] = [
42276
42279
  vue.createTextVNode("确认", -1 /* CACHED */)
42277
42280
  ]))]),
42278
42281
  _: 1 /* STABLE */
42279
- })
42282
+ }, 8 /* PROPS */, ["onClick"])
42280
42283
  ], 4 /* STYLE */)
42281
42284
  ]),
42282
42285
  _: 1 /* STABLE */
@@ -42331,10 +42334,11 @@ const popup = vue.reactive({
42331
42334
  const hdl = {
42332
42335
  // 弹出编辑窗口
42333
42336
  popup() {
42334
- if (!props.myProps.readOnly) {
42335
- popup.formData = JSON.parse(JSON.stringify(modelValue));
42336
- popup.visible = true;
42337
+ if (props.myProps.readOnly) {
42338
+ return
42337
42339
  }
42340
+ popup.formData = JSON.parse(JSON.stringify(modelValue_box));
42341
+ popup.visible = true;
42338
42342
  },
42339
42343
  append() {
42340
42344
  popup.formData.push({ value: '' });
@@ -42343,7 +42347,8 @@ const hdl = {
42343
42347
  popup.formData.splice(index, 1);
42344
42348
  },
42345
42349
  submit() {
42346
- const submittingValue = JSON.parse(JSON.stringify(popup.formData));
42350
+ // 这里不能使用JSON.parse(JSON.stringify()),否则会切断modelValue_box的响应性
42351
+ modelValue_box.splice(0, modelValue_box.length, ...popup.formData);
42347
42352
  // 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
42348
42353
  emit("update:modelValue", submittingValue);
42349
42354
  popup.visible = false;
@@ -42568,7 +42573,6 @@ var script$3 = {
42568
42573
  }
42569
42574
  })
42570
42575
  }
42571
-
42572
42576
  },
42573
42577
  emits: ['update:modelValue', 'change'],
42574
42578
  setup(__props, { emit: __emit }) {
@@ -42585,10 +42589,11 @@ const popup = vue.reactive({
42585
42589
 
42586
42590
  const hdl = {
42587
42591
  popup() {
42588
- if (!props.myProps.readOnly) {
42589
- popup.formData = JSON.parse(JSON.stringify(modelValue_box));
42590
- popup.visible = true;
42592
+ if (props.myProps.readOnly) {
42593
+ return
42591
42594
  }
42595
+ popup.formData = JSON.parse(JSON.stringify(modelValue_box));
42596
+ popup.visible = true;
42592
42597
  },
42593
42598
  append() {
42594
42599
  popup.formData.push({
@@ -42602,9 +42607,10 @@ const hdl = {
42602
42607
  popup.formData.splice(index, 1);
42603
42608
  },
42604
42609
  submit() {
42605
- const submittingValue = JSON.parse(JSON.stringify(popup.formData));
42610
+ // 这里不能使用JSON.parse(JSON.stringify()),否则会切断modelValue_box的响应性
42611
+ modelValue_box.splice(0, modelValue_box.length, ...popup.formData);
42606
42612
  let arrPromise = [];
42607
- submittingValue.forEach(i => {
42613
+ modelValue_box.forEach(i => {
42608
42614
  arrPromise.push(
42609
42615
  request.ly0.storpro({
42610
42616
  noSession: true,
@@ -42615,11 +42621,11 @@ const hdl = {
42615
42621
  });
42616
42622
  Promise.all(arrPromise).then(result => {
42617
42623
  result.forEach((item, index) => {
42618
- submittingValue[index].gbt2260text =
42624
+ modelValue_box[index].gbt2260text =
42619
42625
  item.itemCode6.text2 + '-' + item.itemCode6.text4 + '-' + item.itemCode6.text6;
42620
42626
  });
42621
42627
  // 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
42622
- emit("update:modelValue", submittingValue);
42628
+ emit("update:modelValue", modelValue_box);
42623
42629
  popup.visible = false;
42624
42630
  });
42625
42631
  }
@@ -42658,7 +42664,7 @@ const style = vue.reactive({
42658
42664
  return (_ctx, _cache) => {
42659
42665
  const _component_Edit = vue.resolveComponent("Edit");
42660
42666
  const _component_el_icon = vue.resolveComponent("el-icon");
42661
- const _component_ly0d3gbt2260 = vue.resolveComponent("ly0d3gbt2260");
42667
+ const _component_ly0gbt2260 = vue.resolveComponent("ly0gbt2260");
42662
42668
  const _component_el_input = vue.resolveComponent("el-input");
42663
42669
  const _component_Delete = vue.resolveComponent("Delete");
42664
42670
  const _component_el_button = vue.resolveComponent("el-button");
@@ -42773,7 +42779,7 @@ return (_ctx, _cache) => {
42773
42779
  return (vue.openBlock(), vue.createElementBlock("tr", { key: index }, [
42774
42780
  vue.createCommentVNode(" 左对齐,使用<td> "),
42775
42781
  vue.createElementVNode("td", null, [
42776
- vue.createVNode(_component_ly0d3gbt2260, {
42782
+ vue.createVNode(_component_ly0gbt2260, {
42777
42783
  modelValue: item.gbt2260code,
42778
42784
  "onUpdate:modelValue": $event => ((item.gbt2260code) = $event),
42779
42785
  myProps: { readonly: true }
@@ -42918,12 +42924,11 @@ const hdl = {
42918
42924
  if (props.myProps.readOnly) {
42919
42925
  return
42920
42926
  }
42921
- const copiedValue = JSON.parse(JSON.stringify(modelValue_box));
42922
- popup.formData = copiedValue.map(item => ({
42923
- ...item,
42927
+ popup.formData = JSON.parse(JSON.stringify(modelValue_box));
42928
+ popup.formData.forEach(i => {
42924
42929
  // 价格从“分”转换为“元”
42925
- price: item.price / 100
42926
- }));
42930
+ i.price = i.price / 100;
42931
+ });
42927
42932
  popup.visible = true;
42928
42933
  },
42929
42934
  append() {
@@ -42939,13 +42944,14 @@ const hdl = {
42939
42944
  popup.formData.splice(index, 1);
42940
42945
  },
42941
42946
  submit() {
42942
- const submittingValue = JSON.parse(JSON.stringify(popup.formData));
42943
- submittingValue.forEach(item => {
42947
+ // 这里不能使用JSON.parse(JSON.stringify()),否则会切断modelValue_box的响应性
42948
+ modelValue_box.splice(0, modelValue_box.length, ...popup.formData);
42949
+ modelValue_box.forEach(i => {
42944
42950
  // 确保 price 是数字,然后转为“分”
42945
- item.price = Math.floor(Number(item.price) * 100);
42951
+ i.price = Math.floor(Number(i.price) * 100);
42946
42952
  });
42947
42953
  // 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
42948
- emit("update:modelValue", submittingValue);
42954
+ emit("update:modelValue", modelValue_box);
42949
42955
  popup.visible = false;
42950
42956
  },
42951
42957
  };
@@ -43263,10 +43269,11 @@ const popup = vue.reactive({
43263
43269
 
43264
43270
  const hdl = {
43265
43271
  popup() {
43266
- if (!props.myProps.readOnly) {
43267
- popup.formData = JSON.parse(JSON.stringify(modelValue_box));
43268
- popup.visible = true;
43272
+ if (props.myProps.readOnly) {
43273
+ return
43269
43274
  }
43275
+ popup.formData = JSON.parse(JSON.stringify(modelValue_box));
43276
+ popup.visible = true;
43270
43277
  },
43271
43278
  append() {
43272
43279
  popup.formData.push({
@@ -43279,7 +43286,8 @@ const hdl = {
43279
43286
  popup.formData.splice(index, 1);
43280
43287
  },
43281
43288
  submit() {
43282
- const submittingValue = JSON.parse(JSON.stringify(popup.formData));
43289
+ // 这里不能使用JSON.parse(JSON.stringify()),否则会切断modelValue_box的响应性
43290
+ modelValue_box.splice(0, modelValue_box.length, ...popup.formData);
43283
43291
  // 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
43284
43292
  emit("update:modelValue", submittingValue);
43285
43293
  popup.visible = false;
@@ -43590,8 +43598,9 @@ const hdl = {
43590
43598
  popup.visible = true;
43591
43599
  },
43592
43600
  submit() {
43593
- // 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
43601
+ // 这里不能使用JSON.parse(JSON.stringify()),否则会切断modelValue_box的响应性
43594
43602
  Object.assign(modelValue_box, popup.formData);
43603
+ // 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
43595
43604
  emit("update:modelValue", modelValue_box);
43596
43605
  popup.visible = false;
43597
43606
  },