zzz-pc-view 0.0.8 → 0.0.10
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/package.json
CHANGED
|
@@ -160,7 +160,7 @@ export declare class CurdApi<T extends object = object, P extends PaginationResp
|
|
|
160
160
|
* @param {EditTypeId} saveTypeId - 保存类型的 ID。
|
|
161
161
|
* @returns {Promise<any>} - 返回一个包含保存结果的 Promise。
|
|
162
162
|
*/
|
|
163
|
-
save(data: T, saveTypeId: EditTypeId): httpRequest.HttpRequestPromise<
|
|
163
|
+
save(data: T, saveTypeId: EditTypeId): httpRequest.HttpRequestPromise<T>;
|
|
164
164
|
/**
|
|
165
165
|
* 删除数据。
|
|
166
166
|
* @param {T} data - 包含 ID 的数据对象。
|
package/src/index.es.js
CHANGED
|
@@ -2164,10 +2164,10 @@ const useRequestUtil = (endableLoadStatus) => {
|
|
|
2164
2164
|
// 将 abort 方法添加到响应对象中
|
|
2165
2165
|
abort,
|
|
2166
2166
|
/**
|
|
2167
|
-
*
|
|
2167
|
+
* 定义一个异步方法,用于发送请求并处理响应。
|
|
2168
2168
|
* 这个方法会发送一个 HTTP 请求,并根据请求的结果调用相应的回调函数。
|
|
2169
2169
|
* @method requestData
|
|
2170
|
-
* @param {
|
|
2170
|
+
* @param {httpRequest.HttpRequestPromise} httpRequestPromise - 一个继承自 httpRequest.HttpRequestPromise 的泛型类型,表示 HTTP 请求对象。
|
|
2171
2171
|
* @param {Function} [final] - 一个可选的函数,用于在请求完成后执行最终操作。
|
|
2172
2172
|
* @returns {Promise<T extends httpRequest.HttpRequestPromise<infer R> ? R : never>} - 一个返回值为请求结果的 Promise。
|
|
2173
2173
|
* @description 这个方法会在请求开始时调用 abort 方法,以取消之前的请求。
|
|
@@ -2180,16 +2180,18 @@ const useRequestUtil = (endableLoadStatus) => {
|
|
|
2180
2180
|
abort();
|
|
2181
2181
|
setLoadStatus(true);
|
|
2182
2182
|
request = httpRequestPromise;
|
|
2183
|
+
let isAbort = false;
|
|
2183
2184
|
try {
|
|
2184
2185
|
return await request;
|
|
2185
2186
|
} catch (err) {
|
|
2187
|
+
if (err.code === ABORTED_CODE) {
|
|
2188
|
+
isAbort = true;
|
|
2189
|
+
}
|
|
2186
2190
|
throw err;
|
|
2187
2191
|
} finally {
|
|
2188
2192
|
setLoadStatus(false);
|
|
2189
|
-
|
|
2190
|
-
if (request) {
|
|
2193
|
+
if (!isAbort) {
|
|
2191
2194
|
request = void 0;
|
|
2192
|
-
isAbort = true;
|
|
2193
2195
|
}
|
|
2194
2196
|
final == null ? void 0 : final(isAbort);
|
|
2195
2197
|
}
|
|
@@ -9604,7 +9606,7 @@ class CurdViewHandler extends CurdHandler {
|
|
|
9604
9606
|
const _hoisted_1$4 = { class: "flex column wrapper data-wrapper" };
|
|
9605
9607
|
const _hoisted_2$1 = { class: "flex flex-wrap gap-10 data-wrapper-header" };
|
|
9606
9608
|
const _hoisted_3$1 = { class: "flex gap-10 data-wrapper-footer" };
|
|
9607
|
-
const _sfc_main$
|
|
9609
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
9608
9610
|
__name: "DataWrapperView",
|
|
9609
9611
|
props: {
|
|
9610
9612
|
bodyViewClass: {}
|
|
@@ -9672,7 +9674,7 @@ const useModelValueBridgeComputed = (props, emit) => computed({
|
|
|
9672
9674
|
emit("change", value);
|
|
9673
9675
|
}
|
|
9674
9676
|
});
|
|
9675
|
-
const _sfc_main$
|
|
9677
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
9676
9678
|
__name: "VSlotView",
|
|
9677
9679
|
props: {
|
|
9678
9680
|
component: {},
|
|
@@ -9695,7 +9697,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
9695
9697
|
};
|
|
9696
9698
|
}
|
|
9697
9699
|
});
|
|
9698
|
-
const _sfc_main$
|
|
9700
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
9699
9701
|
__name: "CurdTableView",
|
|
9700
9702
|
props: {
|
|
9701
9703
|
viewHandler: {}
|
|
@@ -9755,7 +9757,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
9755
9757
|
ref_for: true
|
|
9756
9758
|
}, column.colProps || unref(emptyObject2)), {
|
|
9757
9759
|
default: withCtx(({ row }) => [
|
|
9758
|
-
(openBlock(), createBlock(resolveDynamicComponent(column.component || _sfc_main$
|
|
9760
|
+
(openBlock(), createBlock(resolveDynamicComponent(column.component || _sfc_main$a), mergeProps({
|
|
9759
9761
|
viewHandler: _ctx.viewHandler,
|
|
9760
9762
|
model: row,
|
|
9761
9763
|
prop: column.propertyKey,
|
|
@@ -9772,7 +9774,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
9772
9774
|
}
|
|
9773
9775
|
});
|
|
9774
9776
|
const _hoisted_1$3 = { key: 0 };
|
|
9775
|
-
const _sfc_main$
|
|
9777
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
9776
9778
|
__name: "FilterView",
|
|
9777
9779
|
props: {
|
|
9778
9780
|
viewHandler: {},
|
|
@@ -9813,7 +9815,7 @@ const _hoisted_2 = { class: "flex-1 fit-size" };
|
|
|
9813
9815
|
const _hoisted_3 = { class: "curd-list-aside" };
|
|
9814
9816
|
const _hoisted_4 = { class: "flex-1 fit-size curd-list-content" };
|
|
9815
9817
|
const _hoisted_5 = { class: "curd-list-aside" };
|
|
9816
|
-
const _sfc_main$
|
|
9818
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
9817
9819
|
__name: "CurdView",
|
|
9818
9820
|
props: {
|
|
9819
9821
|
viewHandler: {}
|
|
@@ -9822,10 +9824,10 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
9822
9824
|
return (_ctx, _cache) => {
|
|
9823
9825
|
const _component_el_card = resolveComponent("el-card");
|
|
9824
9826
|
const _directive_loading = resolveDirective("loading");
|
|
9825
|
-
return openBlock(), createBlock(_sfc_main$
|
|
9827
|
+
return openBlock(), createBlock(_sfc_main$b, null, {
|
|
9826
9828
|
header: withCtx(() => [
|
|
9827
9829
|
renderSlot(_ctx.$slots, "header-before"),
|
|
9828
|
-
_ctx.viewHandler.displayFilterConfigMap[unref(ZDecorators).FilterKey.PositionEnum.TOP] ? (openBlock(), createBlock(_sfc_main$
|
|
9830
|
+
_ctx.viewHandler.displayFilterConfigMap[unref(ZDecorators).FilterKey.PositionEnum.TOP] ? (openBlock(), createBlock(_sfc_main$8, {
|
|
9829
9831
|
key: 0,
|
|
9830
9832
|
"view-handler": _ctx.viewHandler,
|
|
9831
9833
|
position: unref(ZDecorators).FilterKey.PositionEnum.TOP
|
|
@@ -9846,7 +9848,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
9846
9848
|
default: withCtx(() => [
|
|
9847
9849
|
_ctx.viewHandler.displayFilterConfigMap[unref(ZDecorators).FilterKey.PositionEnum.LEFT] ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
9848
9850
|
createElementVNode("div", _hoisted_3, [
|
|
9849
|
-
createVNode(_sfc_main$
|
|
9851
|
+
createVNode(_sfc_main$8, {
|
|
9850
9852
|
"view-handler": _ctx.viewHandler,
|
|
9851
9853
|
position: unref(ZDecorators).FilterKey.PositionEnum.LEFT
|
|
9852
9854
|
}, null, 8, ["view-handler", "position"])
|
|
@@ -9855,7 +9857,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
9855
9857
|
], 64)) : createCommentVNode("", true),
|
|
9856
9858
|
withDirectives((openBlock(), createElementBlock("div", _hoisted_4, [
|
|
9857
9859
|
renderSlot(_ctx.$slots, "content", {}, () => [
|
|
9858
|
-
createVNode(_sfc_main$
|
|
9860
|
+
createVNode(_sfc_main$9, { "view-handler": _ctx.viewHandler }, null, 8, ["view-handler"])
|
|
9859
9861
|
])
|
|
9860
9862
|
])), [
|
|
9861
9863
|
[_directive_loading, _ctx.viewHandler.listLoadStatus]
|
|
@@ -9863,7 +9865,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
9863
9865
|
_ctx.viewHandler.displayFilterConfigMap[unref(ZDecorators).FilterKey.PositionEnum.RIGHT] ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
9864
9866
|
_cache[1] || (_cache[1] = createElementVNode("div", { class: "curd-list-divider" }, null, -1)),
|
|
9865
9867
|
createElementVNode("div", _hoisted_5, [
|
|
9866
|
-
createVNode(_sfc_main$
|
|
9868
|
+
createVNode(_sfc_main$8, {
|
|
9867
9869
|
"view-handler": _ctx.viewHandler,
|
|
9868
9870
|
position: unref(ZDecorators).FilterKey.PositionEnum.RIGHT
|
|
9869
9871
|
}, null, 8, ["view-handler", "position"])
|
|
@@ -9880,10 +9882,10 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
9880
9882
|
});
|
|
9881
9883
|
const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9882
9884
|
__proto__: null,
|
|
9883
|
-
CurdView: _sfc_main$
|
|
9885
|
+
CurdView: _sfc_main$7,
|
|
9884
9886
|
CurdViewHandler
|
|
9885
9887
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9886
|
-
const _sfc_main$
|
|
9888
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
9887
9889
|
__name: "SelectView",
|
|
9888
9890
|
props: {
|
|
9889
9891
|
options: {},
|
|
@@ -9917,7 +9919,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
9917
9919
|
};
|
|
9918
9920
|
}
|
|
9919
9921
|
});
|
|
9920
|
-
const _sfc_main$
|
|
9922
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
9921
9923
|
__name: "VModelView",
|
|
9922
9924
|
props: {
|
|
9923
9925
|
component: {},
|
|
@@ -9927,7 +9929,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
9927
9929
|
},
|
|
9928
9930
|
setup(__props) {
|
|
9929
9931
|
const props = __props;
|
|
9930
|
-
const mappingComputed = useMappingOption(props, _sfc_main$
|
|
9932
|
+
const mappingComputed = useMappingOption(props, _sfc_main$6, ElInput);
|
|
9931
9933
|
const modelValueBridgeComputed = computed({
|
|
9932
9934
|
get: () => props.model[props.prop],
|
|
9933
9935
|
set: (value) => {
|
|
@@ -9943,7 +9945,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
9943
9945
|
};
|
|
9944
9946
|
}
|
|
9945
9947
|
});
|
|
9946
|
-
const _sfc_main$
|
|
9948
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
9947
9949
|
__name: "RadioButtonGroupView",
|
|
9948
9950
|
props: {
|
|
9949
9951
|
options: {},
|
|
@@ -9977,7 +9979,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9977
9979
|
};
|
|
9978
9980
|
}
|
|
9979
9981
|
});
|
|
9980
|
-
const _sfc_main$
|
|
9982
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
9981
9983
|
__name: "RadioGroupView",
|
|
9982
9984
|
props: {
|
|
9983
9985
|
options: {},
|
|
@@ -10011,16 +10013,51 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
10011
10013
|
};
|
|
10012
10014
|
}
|
|
10013
10015
|
});
|
|
10016
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
10017
|
+
__name: "CheckboxGroupView",
|
|
10018
|
+
props: {
|
|
10019
|
+
options: {},
|
|
10020
|
+
primaryKeyConfig: {},
|
|
10021
|
+
nameKeyConfig: {},
|
|
10022
|
+
modelValue: {}
|
|
10023
|
+
},
|
|
10024
|
+
emits: ["update:modelValue", "change"],
|
|
10025
|
+
setup(__props, { emit: __emit }) {
|
|
10026
|
+
const props = __props;
|
|
10027
|
+
const emit = __emit;
|
|
10028
|
+
const modelValueBridgeComputed = useModelValueBridgeComputed(props, emit);
|
|
10029
|
+
return (_ctx, _cache) => {
|
|
10030
|
+
const _component_el_checkbox = resolveComponent("el-checkbox");
|
|
10031
|
+
const _component_el_checkbox_group = resolveComponent("el-checkbox-group");
|
|
10032
|
+
return openBlock(), createBlock(_component_el_checkbox_group, {
|
|
10033
|
+
modelValue: unref(modelValueBridgeComputed),
|
|
10034
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValueBridgeComputed) ? modelValueBridgeComputed.value = $event : null)
|
|
10035
|
+
}, {
|
|
10036
|
+
default: withCtx(() => [
|
|
10037
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(props.options, (item) => {
|
|
10038
|
+
return openBlock(), createBlock(_component_el_checkbox, {
|
|
10039
|
+
key: item[_ctx.primaryKeyConfig.propertyKey],
|
|
10040
|
+
label: item[_ctx.nameKeyConfig.propertyKey],
|
|
10041
|
+
value: item[_ctx.primaryKeyConfig.propertyKey]
|
|
10042
|
+
}, null, 8, ["label", "value"]);
|
|
10043
|
+
}), 128))
|
|
10044
|
+
]),
|
|
10045
|
+
_: 1
|
|
10046
|
+
}, 8, ["modelValue"]);
|
|
10047
|
+
};
|
|
10048
|
+
}
|
|
10049
|
+
});
|
|
10014
10050
|
const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10015
10051
|
__proto__: null,
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10052
|
+
CheckboxGroupView: _sfc_main$2,
|
|
10053
|
+
RadioButtonGroupView: _sfc_main$4,
|
|
10054
|
+
RadioGroupView: _sfc_main$3,
|
|
10055
|
+
SelectView: _sfc_main$6,
|
|
10056
|
+
VModelView: _sfc_main$5
|
|
10020
10057
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
10021
10058
|
const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10022
10059
|
__proto__: null,
|
|
10023
|
-
VSlotView: _sfc_main$
|
|
10060
|
+
VSlotView: _sfc_main$a
|
|
10024
10061
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
10025
10062
|
const _export_sfc = (sfc, props) => {
|
|
10026
10063
|
const target = sfc.__vccOpts || sfc;
|
|
@@ -10054,7 +10091,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10054
10091
|
});
|
|
10055
10092
|
const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10056
10093
|
__proto__: null,
|
|
10057
|
-
DataWrapper: _sfc_main$
|
|
10094
|
+
DataWrapper: _sfc_main$b,
|
|
10058
10095
|
Main: _sfc_main
|
|
10059
10096
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
10060
10097
|
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|