@yoooloo42/joker 1.0.75 → 1.0.78

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(" 商品分类 "),
@@ -23220,11 +23215,9 @@ return (_ctx, _cache) => {
23220
23215
  (__props.item.inputType === 'd7price')
23221
23216
  ? (openBlock(), createElementBlock("div", _hoisted_26, [
23222
23217
  createVNode(_component_ly0d7price, {
23223
- myProps: {
23224
- readOnly: __props.item.readOnly
23225
- },
23218
+ myProps: {readOnly: __props.item.readOnly},
23226
23219
  modelValue: __props.dataBox.fieldsValue[__props.item.fieldName],
23227
- "onUpdate:modelValue": _cache[7] || (_cache[7] = $event => ((__props.dataBox.fieldsValue[__props.item.fieldName]) = $event))
23220
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = $event => ((__props.dataBox.fieldsValue[__props.item.fieldName]) = $event))
23228
23221
  }, null, 8 /* PROPS */, ["myProps", "modelValue"])
23229
23222
  ]))
23230
23223
  : createCommentVNode("v-if", true),
@@ -41797,29 +41790,40 @@ var upload = {
41797
41790
  const _hoisted_1$5 = { style: {"width":"100%"} };
41798
41791
  const _hoisted_2$5 = { style: {"width":"30%"} };
41799
41792
 
41793
+ // 遵循 Vue 3 v-model 规范,使用 modelValue
41800
41794
 
41801
41795
  var script$5 = {
41802
41796
  __name: 'index',
41803
41797
  props: {
41798
+ // modelValue: 外部 v-model 绑定的值
41799
+ modelValue: {
41800
+ type: String,
41801
+ default: () => ''
41802
+ },
41804
41803
  myProps: {
41805
- type: Object,
41806
- default: () => ({ readOnly: false, value: '', _id: null }) // 提供清晰的默认值
41804
+ readOnly: {
41805
+ type: Boolean,
41806
+ default: false
41807
+ }
41807
41808
  }
41809
+
41808
41810
  },
41809
- emits: ['get-value'],
41811
+ emits: ['update:modelValue', 'change'],
41810
41812
  setup(__props, { emit: __emit }) {
41811
41813
 
41812
41814
  const props = __props;
41815
+ // 遵循 Vue 3 v-model 规范,使用 update:modelValue 事件
41813
41816
  const emit = __emit;
41814
41817
 
41815
- const value = reactive({
41818
+ const value = computed(() => Object.assign({
41816
41819
  code2: '',
41817
41820
  text2: '',
41818
41821
  code4: '',
41819
41822
  text4: '',
41820
41823
  code6: '',
41821
41824
  text6: '',
41822
- });
41825
+ }, {code6: props.modelValue || ''}));
41826
+
41823
41827
  const popup = reactive({
41824
41828
  visible: false,
41825
41829
  select: {
@@ -41913,16 +41917,8 @@ const hdlSubmit = () => {
41913
41917
  value.code6 = popup.select.code6;
41914
41918
  const foundItem6 = popup.select.arrCode6.find(i => i.code6 === value.code6);
41915
41919
  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
- });
41920
+ // 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
41921
+ emit("update:modelValue", value.code6 ?? value.code4 ?? value.code2 ?? '');
41926
41922
  popup.visible = false;
41927
41923
  };
41928
41924
 
@@ -41989,12 +41985,12 @@ return (_ctx, _cache) => {
41989
41985
  createElementVNode("td", null, [
41990
41986
  createElementVNode("span", {
41991
41987
  style: normalizeStyle(style.value.code)
41992
- }, toDisplayString('[' + (value.code2 ? value.code2 : '省') + ']'), 5 /* TEXT, STYLE */)
41988
+ }, toDisplayString('[' + (value.value.code2 ? value.value.code2 : '省') + ']'), 5 /* TEXT, STYLE */)
41993
41989
  ]),
41994
41990
  createElementVNode("td", null, [
41995
41991
  createElementVNode("span", {
41996
41992
  style: normalizeStyle(style.value.text)
41997
- }, toDisplayString(value.text2 ? value.text2 : ''), 5 /* TEXT, STYLE */)
41993
+ }, toDisplayString(value.value.text2 ? value.value.text2 : ''), 5 /* TEXT, STYLE */)
41998
41994
  ])
41999
41995
  ]),
42000
41996
  createElementVNode("tr", null, [
@@ -42002,12 +41998,12 @@ return (_ctx, _cache) => {
42002
41998
  createElementVNode("td", null, [
42003
41999
  createElementVNode("span", {
42004
42000
  style: normalizeStyle(style.value.code)
42005
- }, toDisplayString('[' + (value.code4 ? value.code4 : '市') + ']'), 5 /* TEXT, STYLE */)
42001
+ }, toDisplayString('[' + (value.value.code4 ? value.value.code4 : '市') + ']'), 5 /* TEXT, STYLE */)
42006
42002
  ]),
42007
42003
  createElementVNode("td", null, [
42008
42004
  createElementVNode("span", {
42009
42005
  style: normalizeStyle(style.value.text)
42010
- }, toDisplayString(value.text4 ? value.text4 : ''), 5 /* TEXT, STYLE */)
42006
+ }, toDisplayString(value.value.text4 ? value.value.text4 : ''), 5 /* TEXT, STYLE */)
42011
42007
  ])
42012
42008
  ]),
42013
42009
  createElementVNode("tr", null, [
@@ -42015,12 +42011,12 @@ return (_ctx, _cache) => {
42015
42011
  createElementVNode("td", null, [
42016
42012
  createElementVNode("span", {
42017
42013
  style: normalizeStyle(style.value.code)
42018
- }, toDisplayString('[' + (value.code6 ? value.code6 : '县') + ']'), 5 /* TEXT, STYLE */)
42014
+ }, toDisplayString('[' + (value.value.code6 ? value.value.code6 : '县') + ']'), 5 /* TEXT, STYLE */)
42019
42015
  ]),
42020
42016
  createElementVNode("td", null, [
42021
42017
  createElementVNode("span", {
42022
42018
  style: normalizeStyle(style.value.text)
42023
- }, toDisplayString(value.text6 ? value.text6 : ''), 5 /* TEXT, STYLE */)
42019
+ }, toDisplayString(value.value.text6 ? value.value.text6 : ''), 5 /* TEXT, STYLE */)
42024
42020
  ])
42025
42021
  ])
42026
42022
  ])
@@ -42606,8 +42602,7 @@ var script$2 = {
42606
42602
  readOnly: {
42607
42603
  type: Boolean,
42608
42604
  default: false
42609
- },
42610
- _id: [String, Number] // 允许传入一个 _id 用于回传,可选
42605
+ }
42611
42606
  }
42612
42607
 
42613
42608
  },