dfs-page-config 0.4.79 → 0.4.81
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/dfs-page-config.js +55 -25
- package/dist/dfs-page-config.umd.cjs +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/dfs-page-config.js
CHANGED
|
@@ -27047,7 +27047,28 @@ const _MessageBox = MessageBox;
|
|
|
27047
27047
|
_MessageBox.install = (k) => {
|
|
27048
27048
|
_MessageBox._context = k._context, k.config.globalProperties.$msgbox = _MessageBox, k.config.globalProperties.$messageBox = _MessageBox, k.config.globalProperties.$alert = _MessageBox.alert, k.config.globalProperties.$confirm = _MessageBox.confirm, k.config.globalProperties.$prompt = _MessageBox.prompt;
|
|
27049
27049
|
};
|
|
27050
|
-
const ElMessageBox = _MessageBox, base = "", elBadge = "", elMessage = "";
|
|
27050
|
+
const ElMessageBox = _MessageBox, base = "", elBadge = "", elMessage = "", requestTimestamps = /* @__PURE__ */ new Map();
|
|
27051
|
+
function logRequestTime(k, L, ie) {
|
|
27052
|
+
const ae = ie - L;
|
|
27053
|
+
ae > 2e3 && console.warn(`接口请求超时: ${k}, 耗时: ${ae}ms`);
|
|
27054
|
+
}
|
|
27055
|
+
const requestMonitor = {
|
|
27056
|
+
/**
|
|
27057
|
+
* 记录请求开始时间
|
|
27058
|
+
* @param url 请求URL
|
|
27059
|
+
*/
|
|
27060
|
+
startRequest(k) {
|
|
27061
|
+
requestTimestamps.set(k, Date.now());
|
|
27062
|
+
},
|
|
27063
|
+
/**
|
|
27064
|
+
* 结束请求并计算耗时
|
|
27065
|
+
* @param url 请求URL
|
|
27066
|
+
*/
|
|
27067
|
+
endRequest(k) {
|
|
27068
|
+
const L = Date.now(), ie = requestTimestamps.get(k);
|
|
27069
|
+
ie && (logRequestTime(k, ie, L), requestTimestamps.delete(k));
|
|
27070
|
+
}
|
|
27071
|
+
};
|
|
27051
27072
|
function errorHandle(k, L, ie) {
|
|
27052
27073
|
var pe, _e;
|
|
27053
27074
|
let ae = ((pe = k == null ? void 0 : k.data) == null ? void 0 : pe.message) || ((_e = k == null ? void 0 : k.data) == null ? void 0 : _e.msg);
|
|
@@ -27077,17 +27098,22 @@ const service = axios.create({
|
|
|
27077
27098
|
});
|
|
27078
27099
|
service.interceptors.request.use(
|
|
27079
27100
|
(k) => {
|
|
27080
|
-
k.url = handleProxy(k.url);
|
|
27101
|
+
requestMonitor.startRequest(k.url), k.url = handleProxy(k.url);
|
|
27081
27102
|
const L = getRequestHeaders(k.url);
|
|
27082
27103
|
return Object.keys(L).forEach((ie) => {
|
|
27083
27104
|
k.headers[ie] = L[ie];
|
|
27084
27105
|
}), k;
|
|
27085
27106
|
},
|
|
27086
|
-
(k) =>
|
|
27107
|
+
(k) => {
|
|
27108
|
+
var ie;
|
|
27109
|
+
const L = (ie = k.config) == null ? void 0 : ie.url;
|
|
27110
|
+
return L && requestMonitor.endRequest(L), Promise.reject(k.data);
|
|
27111
|
+
}
|
|
27087
27112
|
);
|
|
27088
27113
|
service.interceptors.response.use(
|
|
27089
27114
|
(k) => {
|
|
27090
|
-
|
|
27115
|
+
const L = k.config.url;
|
|
27116
|
+
if (requestMonitor.endRequest(L), k.data.code == 1304 || k.data.code === 20007)
|
|
27091
27117
|
window.location.href = k.data.data;
|
|
27092
27118
|
else {
|
|
27093
27119
|
if (k.data.code === 401 || k.data.code === 10001)
|
|
@@ -27099,18 +27125,22 @@ service.interceptors.response.use(
|
|
|
27099
27125
|
if (Object.prototype.toString.call(k.data.data).toLowerCase() == "[object object]")
|
|
27100
27126
|
return k.data.data;
|
|
27101
27127
|
if (typeof k.data.data == "string" && k.data.data != "") {
|
|
27102
|
-
let
|
|
27128
|
+
let ie = {};
|
|
27103
27129
|
try {
|
|
27104
|
-
|
|
27130
|
+
ie = JSON.parse(k.data.data);
|
|
27105
27131
|
} catch {
|
|
27106
|
-
|
|
27132
|
+
ie = k.data.data;
|
|
27107
27133
|
}
|
|
27108
|
-
return
|
|
27134
|
+
return ie;
|
|
27109
27135
|
} else
|
|
27110
27136
|
return k.data.data;
|
|
27111
27137
|
}
|
|
27112
27138
|
},
|
|
27113
|
-
(k) =>
|
|
27139
|
+
(k) => {
|
|
27140
|
+
var ie;
|
|
27141
|
+
const L = (ie = k.config) == null ? void 0 : ie.url;
|
|
27142
|
+
return L && requestMonitor.endRequest(L), errorHandle(k.response), Promise.reject(k);
|
|
27143
|
+
}
|
|
27114
27144
|
);
|
|
27115
27145
|
const initPage = (k, L) => {
|
|
27116
27146
|
L.dispatch("_INIT_PAGE", {
|
|
@@ -27138,7 +27168,7 @@ function getComp(k, L) {
|
|
|
27138
27168
|
}
|
|
27139
27169
|
function getRelationComp(k, L, ie) {
|
|
27140
27170
|
const ae = {};
|
|
27141
|
-
return ie.forEach((pe) => {
|
|
27171
|
+
return ie && ie.length && ie.forEach((pe) => {
|
|
27142
27172
|
const _e = getTargetComp(k, L, pe);
|
|
27143
27173
|
ae[pe] = _e;
|
|
27144
27174
|
}), ae;
|
|
@@ -27274,11 +27304,12 @@ const store = createStore$1({
|
|
|
27274
27304
|
[Ne]: Ie || {},
|
|
27275
27305
|
method: L.method || "POST"
|
|
27276
27306
|
}).then(($e) => {
|
|
27307
|
+
var qe;
|
|
27277
27308
|
const Et = filterRes($e, L);
|
|
27278
|
-
L.searchAfter && L.searchAfter(Et, $e, L) === !1 || (pe ? L.selectedNodes.forEach((
|
|
27279
|
-
for (let
|
|
27280
|
-
const
|
|
27281
|
-
|
|
27309
|
+
L.searchAfter && L.searchAfter(Et, $e, L) === !1 || (pe ? (qe = L.selectedNodes) == null || qe.forEach((Dt) => {
|
|
27310
|
+
for (let Ue = 0; Ue < Et.result.length; Ue++) {
|
|
27311
|
+
const kt = Et.result[Ue];
|
|
27312
|
+
Dt.data[pe.dataKey] == kt[pe.dataKey] && Dt.setData(kt);
|
|
27282
27313
|
}
|
|
27283
27314
|
}) : k.commit("updateRowData", { tableComp: L, res: Et }));
|
|
27284
27315
|
}).finally(() => {
|
|
@@ -29088,9 +29119,10 @@ const __unplugin_components_0$2 = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["re
|
|
|
29088
29119
|
allDisabled: !1,
|
|
29089
29120
|
formData: pe.formData,
|
|
29090
29121
|
row: {},
|
|
29091
|
-
loading: !1
|
|
29122
|
+
loading: !1,
|
|
29123
|
+
relation: getRelationComp(ie, k.pageKey, pe.relation)
|
|
29092
29124
|
});
|
|
29093
|
-
pe.submit = Ne, pe.reset = Ie, _e.elementGroup = computed$1(() => pe.elementGroup.filter((Dt) => Dt.isShow === void 0 || typeof Dt.isShow == "function" && Dt.isShow(_e.formData)));
|
|
29125
|
+
pe.submit = Ne, pe.reset = Ie, _e.elementGroup = computed$1(() => pe.elementGroup.filter((Dt) => Dt.isShow === void 0 || typeof Dt.isShow == "function" && Dt.isShow(_e.formData, _e.relation)));
|
|
29094
29126
|
function xe() {
|
|
29095
29127
|
pe.elementGroup.forEach((Dt) => {
|
|
29096
29128
|
(Dt.type === "Select" || Dt.type === "Cascader" || Dt.type === "radioGroup") && Dt.url && !Dt.remote && getSelectOption(ie, Dt, k.pageKey);
|
|
@@ -29137,10 +29169,8 @@ const __unplugin_components_0$2 = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["re
|
|
|
29137
29169
|
}
|
|
29138
29170
|
function $e(Dt) {
|
|
29139
29171
|
if (pe.submitBefore) {
|
|
29140
|
-
|
|
29141
|
-
|
|
29142
|
-
const kt = pe.submitBefore({ relation: Ue, formData: pe.formData, row: pe.row, triggerButton: Dt });
|
|
29143
|
-
return kt === !1 ? !1 : kt;
|
|
29172
|
+
const Ue = pe.submitBefore({ relation: _e.relation, formData: pe.formData, row: pe.row, triggerButton: Dt });
|
|
29173
|
+
return Ue === !1 ? !1 : Ue;
|
|
29144
29174
|
}
|
|
29145
29175
|
return !0;
|
|
29146
29176
|
}
|
|
@@ -29175,7 +29205,7 @@ const __unplugin_components_0$2 = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["re
|
|
|
29175
29205
|
remoteMethod: Oe
|
|
29176
29206
|
};
|
|
29177
29207
|
}
|
|
29178
|
-
}),
|
|
29208
|
+
}), Form_vue_vue_type_style_index_0_scoped_85691c08_lang = "", _hoisted_1$g = {
|
|
29179
29209
|
key: 0,
|
|
29180
29210
|
class: "mask"
|
|
29181
29211
|
};
|
|
@@ -29196,7 +29226,7 @@ function _sfc_render$h(k, L, ie, ae, pe, _e) {
|
|
|
29196
29226
|
key: ir.prop,
|
|
29197
29227
|
label: ir.label,
|
|
29198
29228
|
prop: ir.prop || "",
|
|
29199
|
-
rules: typeof ir.rules == "function" ? ir.rules(k.formData) : ir.rules,
|
|
29229
|
+
rules: typeof ir.rules == "function" ? ir.rules(k.formData, k.relation) : ir.rules,
|
|
29200
29230
|
class: normalizeClass([ir.className, !k.open && wr > 4 ? "hide-item" : ""]),
|
|
29201
29231
|
style: normalizeStyle({
|
|
29202
29232
|
width: ir.width || k.formItemWidth,
|
|
@@ -29213,7 +29243,7 @@ function _sfc_render$h(k, L, ie, ae, pe, _e) {
|
|
|
29213
29243
|
}, null, 8, ["option", "formComp", "pageKey"])) : ir.type === "Input" ? (openBlock(), createBlock(Oe, {
|
|
29214
29244
|
key: 1,
|
|
29215
29245
|
clearable: "",
|
|
29216
|
-
disabled: typeof ir.disabled == "function" ? ir.disabled(k.formData) : ir.disabled || ir.disable,
|
|
29246
|
+
disabled: typeof ir.disabled == "function" ? ir.disabled(k.formData, k.relation) : ir.disabled || ir.disable,
|
|
29217
29247
|
"show-password": ir.inputType === "password",
|
|
29218
29248
|
type: ir.inputType || "text",
|
|
29219
29249
|
modelValue: k.formData[ir.prop],
|
|
@@ -29269,7 +29299,7 @@ function _sfc_render$h(k, L, ie, ae, pe, _e) {
|
|
|
29269
29299
|
onVisibleChange: (hr) => {
|
|
29270
29300
|
ir.visibleChange && ir.visibleChange(hr, { formComp: k.componentOption, value: k.formData[ir.prop], option: ir });
|
|
29271
29301
|
},
|
|
29272
|
-
disabled: typeof ir.disabled == "function" ? ir.disabled(k.formData) : ir.disabled,
|
|
29302
|
+
disabled: typeof ir.disabled == "function" ? ir.disabled(k.formData, k.relation) : ir.disabled,
|
|
29273
29303
|
"collapse-tags": ir.collapseTags,
|
|
29274
29304
|
"collapse-tags-tooltip": ir.collapseTagsTooltip
|
|
29275
29305
|
}, {
|
|
@@ -29498,7 +29528,7 @@ function _sfc_render$h(k, L, ie, ae, pe, _e) {
|
|
|
29498
29528
|
_: 3
|
|
29499
29529
|
}, 8, ["class", "model", "size", "inline", "label-width", "style"]);
|
|
29500
29530
|
}
|
|
29501
|
-
const Form = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$h], ["__scopeId", "data-v-
|
|
29531
|
+
const Form = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$h], ["__scopeId", "data-v-85691c08"]]), _sfc_main$h = defineComponent({
|
|
29502
29532
|
name: "Upload",
|
|
29503
29533
|
props: {
|
|
29504
29534
|
url: String,
|