@ebiz/designer-components 0.0.18-kzy.4 → 0.0.18-kzy.6

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.mjs CHANGED
@@ -126955,9 +126955,16 @@ const ps = {
126955
126955
  "BATCH_DEL_DATA",
126956
126956
  "MULTIPLE_DATA_LINK_SEARCH"
126957
126957
  ], i = t, { text: o, isNormal: a, disabled: l, type: s, size: u, apiConfig: c, data: d, isUseMethod: f } = ot(n), h = re("请先设置接口配置"), p = () => {
126958
- n.onClick(), !a.value && c.value.apiId && (n.onPrepare(), ps.fetch(d.value, { key: c.value.key, apiId: c.value.apiId, apiType: r[c.value.apiType] }).then((v) => {
126959
- i("click", v), n.onFinish();
126960
- }));
126958
+ if (n.onClick(), !(a.value || !isValidApiConfig()))
126959
+ try {
126960
+ if (n.onPrepare() === !1)
126961
+ return null;
126962
+ ps.fetch(d.value, { key: c.value.key, apiId: c.value.apiId, apiType: r[c.value.apiType] }).then((m) => {
126963
+ i("click", m), n.onFinish();
126964
+ });
126965
+ } catch (v) {
126966
+ n.onError(v);
126967
+ }
126961
126968
  };
126962
126969
  return (v, m) => (T(), se(ht(Xn), {
126963
126970
  content: !ht(a) && !ht(c).apiId ? h.value : "",
@@ -138108,7 +138115,7 @@ const uDt = /* @__PURE__ */ Rt(rMt, [["render", iMt], ["__scopeId", "data-v-491f
138108
138115
  size: {
138109
138116
  type: String,
138110
138117
  default: "",
138111
- validator: (e) => ["small", "medium", "large"].includes(e)
138118
+ validator: (e) => ["small", "medium", "large", ""].includes(e)
138112
138119
  },
138113
138120
  /**
138114
138121
  * 空数据文本
@@ -138216,9 +138223,8 @@ const uDt = /* @__PURE__ */ Rt(rMt, [["render", iMt], ["__scopeId", "data-v-491f
138216
138223
  (T(!0), R(Te, null, Je(d.value, (w) => (T(), se(ht(al), {
138217
138224
  key: w.value,
138218
138225
  value: w.value,
138219
- label: w.label,
138220
- onClick: (k) => y.handleClick(w.value)
138221
- }, null, 8, ["value", "label", "onClick"]))), 128))
138226
+ label: w.label
138227
+ }, null, 8, ["value", "label"]))), 128))
138222
138228
  ]),
138223
138229
  _: 2
138224
138230
  }, [
@@ -138238,7 +138244,7 @@ const uDt = /* @__PURE__ */ Rt(rMt, [["render", iMt], ["__scopeId", "data-v-491f
138238
138244
  } : void 0
138239
138245
  ]), 1032, ["modelValue", "loading", "multiple", "placeholder", "clearable", "disabled", "size", "empty", "popupProps"]));
138240
138246
  }
138241
- }), CDt = /* @__PURE__ */ Rt(e9t, [["__scopeId", "data-v-4ddb0e5f"]]), t9t = {
138247
+ }), CDt = /* @__PURE__ */ Rt(e9t, [["__scopeId", "data-v-9da31a27"]]), t9t = {
138242
138248
  name: "EbizTimeline"
138243
138249
  }, n9t = /* @__PURE__ */ Object.assign(t9t, {
138244
138250
  props: {
@@ -138302,6 +138308,7 @@ export {
138302
138308
  V$t as EbizFileUpload,
138303
138309
  s9t as EbizFormContainer,
138304
138310
  aDt as EbizGrid,
138311
+ CDt as EbizGridEditorSelect,
138305
138312
  _P as EbizMessage,
138306
138313
  z$t as EbizMindmap,
138307
138314
  L$t as EbizOkrTree,
@@ -138350,6 +138357,5 @@ export {
138350
138357
  q$t as TdesignCalendar,
138351
138358
  W$t as TdesignCollapse,
138352
138359
  K$t as TdesignCollapsePanel,
138353
- CDt as TinyGridEditorSelect,
138354
138360
  ps as dataService
138355
138361
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebiz/designer-components",
3
- "version": "0.0.18-kzy.4",
3
+ "version": "0.0.18-kzy.6",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -90,12 +90,24 @@ const tooltipText = ref('请先设置接口配置')
90
90
 
91
91
  const click = () => {
92
92
  props.onClick()
93
- if (!isNormal.value && apiConfig.value.apiId) {
94
- props.onPrepare()
93
+ // 如果是普通按钮或API配置无效,不调用接口
94
+ if (isNormal.value || !isValidApiConfig()) {
95
+ return
96
+ }
97
+
98
+ try {
99
+ // 调用前置处理并获取返回值
100
+ const shouldContinue = props.onPrepare()
101
+ if (shouldContinue === false) {
102
+ return null
103
+ }
104
+
95
105
  dataService.fetch(data.value, { key: apiConfig.value.key, apiId: apiConfig.value.apiId, apiType: apiMap[apiConfig.value.apiType] }).then((res) => {
96
106
  emit('click', res)
97
107
  props.onFinish()
98
108
  })
109
+ } catch (error) {
110
+ props.onError(error)
99
111
  }
100
112
  }
101
113
 
@@ -2,8 +2,7 @@
2
2
  <t-select ref="selectRef" v-model="selectedValue" :loading="loading" :filterable="true" @search="handleRemoteSearch"
3
3
  :multiple="multiple" :placeholder="placeholder" :clearable="clearable" :disabled="disabled" :size="size"
4
4
  :empty="emptyText" :popupProps="popupProps" @change="handleChange" @focus="handleFocus" @blur="handleBlur">
5
- <t-option v-for="item in options" :key="item.value" :value="item.value" :label="item.label"
6
- @click="handleClick(item.value)"></t-option>
5
+ <t-option v-for="item in options" :key="item.value" :value="item.value" :label="item.label"></t-option>
7
6
  <template #prefixIcon v-if="$slots.prefix">
8
7
  <slot name="prefix"></slot>
9
8
  </template>
@@ -98,7 +97,7 @@ const props = defineProps({
98
97
  size: {
99
98
  type: String,
100
99
  default: '',
101
- validator: (val) => ['small', 'medium', 'large'].includes(val)
100
+ validator: (val) => ['small', 'medium', 'large', ''].includes(val)
102
101
  },
103
102
  /**
104
103
  * 空数据文本
package/src/index.js CHANGED
@@ -57,7 +57,7 @@ import EbizDetailBlock from './components/EbizDetailBlock.vue';
57
57
  import EbizTree from './components/EbizTree.vue';
58
58
  import EbizTreeSelector from './components/EbizTreeSelector.vue';
59
59
  import EbizTimePicker from './components/EbizTimePicker.vue';
60
- import TinyGridEditorSelect from './components/TinyGridEditorSelect.vue';
60
+ import EbizGridEditorSelect from './components/EbizGridEditorSelect.vue';
61
61
  import { MessagePlugin as EbizMessage } from 'tdesign-vue-next';
62
62
 
63
63
  // 导入简洁数据服务
@@ -172,5 +172,5 @@ export {
172
172
  EbizTreeSelector,
173
173
  // 时间选择器组件
174
174
  EbizTimePicker,
175
- TinyGridEditorSelect // 表格编辑专用select组件
175
+ EbizGridEditorSelect // 表格编辑专用select组件
176
176
  };