@yoooloo42/joker 1.0.75 → 1.0.77

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
@@ -22749,9 +22749,6 @@ const style = vue.reactive({
22749
22749
  });
22750
22750
 
22751
22751
  const hdlGetValue = {
22752
- gbt2260(result) {
22753
- props.dataBox.fieldsValue[props.item.fieldName] = !!result.code6 ? result.code6 : '';
22754
- },
22755
22752
  ly0d7group(result) {
22756
22753
  props.dataBox.fieldsValue[props.item.fieldName] = !!result.value ? result.value : [];
22757
22754
  },
@@ -23188,12 +23185,10 @@ return (_ctx, _cache) => {
23188
23185
  (__props.item.inputType === 'd3gbt2260')
23189
23186
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_23, [
23190
23187
  vue.createVNode(_component_ly0gbt2260, {
23191
- myProps: {
23192
- value: __props.dataBox.fieldsValue[__props.item.fieldName] ? __props.dataBox.fieldsValue[__props.item.fieldName] : '',
23193
- readOnly: __props.item.readOnly
23194
- },
23195
- onGetValue: hdlGetValue.gbt2260
23196
- }, null, 8 /* PROPS */, ["myProps", "onGetValue"])
23188
+ myProps: {readOnly: __props.item.readOnly},
23189
+ modelValue: __props.dataBox.fieldsValue[__props.item.fieldName],
23190
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = $event => ((__props.dataBox.fieldsValue[__props.item.fieldName]) = $event))
23191
+ }, null, 8 /* PROPS */, ["myProps", "modelValue"])
23197
23192
  ]))
23198
23193
  : vue.createCommentVNode("v-if", true),
23199
23194
  vue.createCommentVNode(" 商品分类 "),
@@ -23228,7 +23223,7 @@ return (_ctx, _cache) => {
23228
23223
  readOnly: __props.item.readOnly
23229
23224
  },
23230
23225
  modelValue: __props.dataBox.fieldsValue[__props.item.fieldName],
23231
- "onUpdate:modelValue": _cache[7] || (_cache[7] = $event => ((__props.dataBox.fieldsValue[__props.item.fieldName]) = $event))
23226
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = $event => ((__props.dataBox.fieldsValue[__props.item.fieldName]) = $event))
23232
23227
  }, null, 8 /* PROPS */, ["myProps", "modelValue"])
23233
23228
  ]))
23234
23229
  : vue.createCommentVNode("v-if", true),
@@ -41801,22 +41796,32 @@ var upload = {
41801
41796
  const _hoisted_1$5 = { style: {"width":"100%"} };
41802
41797
  const _hoisted_2$5 = { style: {"width":"30%"} };
41803
41798
 
41799
+ // 遵循 Vue 3 v-model 规范,使用 modelValue
41804
41800
 
41805
41801
  var script$5 = {
41806
41802
  __name: 'index',
41807
41803
  props: {
41804
+ // modelValue: 外部 v-model 绑定的值
41805
+ modelValue: {
41806
+ type: String,
41807
+ default: () => ''
41808
+ },
41808
41809
  myProps: {
41809
- type: Object,
41810
- default: () => ({ readOnly: false, value: '', _id: null }) // 提供清晰的默认值
41810
+ readOnly: {
41811
+ type: Boolean,
41812
+ default: false
41813
+ }
41811
41814
  }
41815
+
41812
41816
  },
41813
- emits: ['get-value'],
41817
+ emits: ['update:modelValue', 'change'],
41814
41818
  setup(__props, { emit: __emit }) {
41815
41819
 
41816
41820
  const props = __props;
41821
+ // 遵循 Vue 3 v-model 规范,使用 update:modelValue 事件
41817
41822
  const emit = __emit;
41818
41823
 
41819
- const value = vue.reactive({
41824
+ const value = vue.computed(() => props.modelValue || {
41820
41825
  code2: '',
41821
41826
  text2: '',
41822
41827
  code4: '',
@@ -41824,6 +41829,7 @@ const value = vue.reactive({
41824
41829
  code6: '',
41825
41830
  text6: '',
41826
41831
  });
41832
+
41827
41833
  const popup = vue.reactive({
41828
41834
  visible: false,
41829
41835
  select: {
@@ -41917,16 +41923,8 @@ const hdlSubmit = () => {
41917
41923
  value.code6 = popup.select.code6;
41918
41924
  const foundItem6 = popup.select.arrCode6.find(i => i.code6 === value.code6);
41919
41925
  value.text6 = foundItem6 ? foundItem6.text6 : '';
41920
- emit("get-value", {
41921
- code6: value.code6
41922
- ? value.code6
41923
- : value.code4
41924
- ? value.code4
41925
- : value.code2
41926
- ? value.code2
41927
- : '',
41928
- _id: '_id' in props.myProps ? props.myProps._id : null,
41929
- });
41926
+ // 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
41927
+ emit("update:modelValue", value.code6 ?? value.code4 ?? value.code2 ?? '');
41930
41928
  popup.visible = false;
41931
41929
  };
41932
41930
 
@@ -41993,12 +41991,12 @@ return (_ctx, _cache) => {
41993
41991
  vue.createElementVNode("td", null, [
41994
41992
  vue.createElementVNode("span", {
41995
41993
  style: vue.normalizeStyle(style.value.code)
41996
- }, vue.toDisplayString('[' + (value.code2 ? value.code2 : '省') + ']'), 5 /* TEXT, STYLE */)
41994
+ }, vue.toDisplayString('[' + (value.value.code2 ? value.value.code2 : '省') + ']'), 5 /* TEXT, STYLE */)
41997
41995
  ]),
41998
41996
  vue.createElementVNode("td", null, [
41999
41997
  vue.createElementVNode("span", {
42000
41998
  style: vue.normalizeStyle(style.value.text)
42001
- }, vue.toDisplayString(value.text2 ? value.text2 : ''), 5 /* TEXT, STYLE */)
41999
+ }, vue.toDisplayString(value.value.text2 ? value.value.text2 : ''), 5 /* TEXT, STYLE */)
42002
42000
  ])
42003
42001
  ]),
42004
42002
  vue.createElementVNode("tr", null, [
@@ -42006,12 +42004,12 @@ return (_ctx, _cache) => {
42006
42004
  vue.createElementVNode("td", null, [
42007
42005
  vue.createElementVNode("span", {
42008
42006
  style: vue.normalizeStyle(style.value.code)
42009
- }, vue.toDisplayString('[' + (value.code4 ? value.code4 : '市') + ']'), 5 /* TEXT, STYLE */)
42007
+ }, vue.toDisplayString('[' + (value.value.code4 ? value.value.code4 : '市') + ']'), 5 /* TEXT, STYLE */)
42010
42008
  ]),
42011
42009
  vue.createElementVNode("td", null, [
42012
42010
  vue.createElementVNode("span", {
42013
42011
  style: vue.normalizeStyle(style.value.text)
42014
- }, vue.toDisplayString(value.text4 ? value.text4 : ''), 5 /* TEXT, STYLE */)
42012
+ }, vue.toDisplayString(value.value.text4 ? value.value.text4 : ''), 5 /* TEXT, STYLE */)
42015
42013
  ])
42016
42014
  ]),
42017
42015
  vue.createElementVNode("tr", null, [
@@ -42019,12 +42017,12 @@ return (_ctx, _cache) => {
42019
42017
  vue.createElementVNode("td", null, [
42020
42018
  vue.createElementVNode("span", {
42021
42019
  style: vue.normalizeStyle(style.value.code)
42022
- }, vue.toDisplayString('[' + (value.code6 ? value.code6 : '县') + ']'), 5 /* TEXT, STYLE */)
42020
+ }, vue.toDisplayString('[' + (value.value.code6 ? value.value.code6 : '县') + ']'), 5 /* TEXT, STYLE */)
42023
42021
  ]),
42024
42022
  vue.createElementVNode("td", null, [
42025
42023
  vue.createElementVNode("span", {
42026
42024
  style: vue.normalizeStyle(style.value.text)
42027
- }, vue.toDisplayString(value.text6 ? value.text6 : ''), 5 /* TEXT, STYLE */)
42025
+ }, vue.toDisplayString(value.value.text6 ? value.value.text6 : ''), 5 /* TEXT, STYLE */)
42028
42026
  ])
42029
42027
  ])
42030
42028
  ])