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