dfs-page-config 0.9.6 → 0.9.7
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 +96 -101
- package/dist/dfs-page-config.umd.cjs +3 -3
- package/dist/op-trace.cjs +1 -1
- package/dist/op-trace.js +37 -42
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/dfs-page-config.js
CHANGED
|
@@ -56633,102 +56633,7 @@ function _sfc_render$k(Ff, kh, tAe, oAe, uAe, pAe) {
|
|
|
56633
56633
|
}, 1032, ["type", "onClick", "size"]))), 128))
|
|
56634
56634
|
]));
|
|
56635
56635
|
}
|
|
56636
|
-
const __unplugin_components_1$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["render", _sfc_render$k], ["__scopeId", "data-v-50ed1da4"]])
|
|
56637
|
-
function withTraceAction(Ff, kh) {
|
|
56638
|
-
return Ff ? {
|
|
56639
|
-
needReason: !0,
|
|
56640
|
-
headers: { ...kh, "X-Op-Action": Ff }
|
|
56641
|
-
} : {};
|
|
56642
|
-
}
|
|
56643
|
-
const DEFAULTS = {
|
|
56644
|
-
title: "操作留痕",
|
|
56645
|
-
message: "请填写操作原因",
|
|
56646
|
-
batchMessage: "请填写本次批量操作原因",
|
|
56647
|
-
placeholder: "必填,将随本次操作记录",
|
|
56648
|
-
confirmText: "确认",
|
|
56649
|
-
cancelText: "取消",
|
|
56650
|
-
reasonHeader: "X-Op-Reason",
|
|
56651
|
-
required: !0,
|
|
56652
|
-
requiredMessage: "请输入操作原因"
|
|
56653
|
-
}, runtimes = /* @__PURE__ */ new WeakMap();
|
|
56654
|
-
function eject(Ff, kh) {
|
|
56655
|
-
var tAe, oAe;
|
|
56656
|
-
kh !== null && ((oAe = (tAe = Ff.interceptors) == null ? void 0 : tAe.request) == null || oAe.eject(kh));
|
|
56657
|
-
}
|
|
56658
|
-
function setReasonHeader(Ff, kh, tAe) {
|
|
56659
|
-
Ff.headers = Ff.headers || {}, Ff.headers[kh] = tAe;
|
|
56660
|
-
}
|
|
56661
|
-
function askReason(Ff, kh) {
|
|
56662
|
-
const { config: tAe } = Ff;
|
|
56663
|
-
return ElMessageBox.prompt(kh, tAe.title, {
|
|
56664
|
-
inputType: "textarea",
|
|
56665
|
-
inputPlaceholder: tAe.placeholder,
|
|
56666
|
-
confirmButtonText: tAe.confirmText,
|
|
56667
|
-
cancelButtonText: tAe.cancelText,
|
|
56668
|
-
...tAe.required && {
|
|
56669
|
-
inputPattern: /\S+/,
|
|
56670
|
-
inputErrorMessage: tAe.requiredMessage
|
|
56671
|
-
}
|
|
56672
|
-
}).then((oAe) => (oAe == null ? void 0 : oAe.value) || "");
|
|
56673
|
-
}
|
|
56674
|
-
async function withBusyPaused(Ff, kh) {
|
|
56675
|
-
var oAe;
|
|
56676
|
-
let tAe = !1;
|
|
56677
|
-
try {
|
|
56678
|
-
(oAe = Ff.busy) != null && oAe.isBusy() && (Ff.busy.setBusy(!1), tAe = !0);
|
|
56679
|
-
} catch {
|
|
56680
|
-
}
|
|
56681
|
-
try {
|
|
56682
|
-
return await kh();
|
|
56683
|
-
} finally {
|
|
56684
|
-
if (tAe)
|
|
56685
|
-
try {
|
|
56686
|
-
Ff.busy.setBusy(!0);
|
|
56687
|
-
} catch {
|
|
56688
|
-
}
|
|
56689
|
-
}
|
|
56690
|
-
}
|
|
56691
|
-
async function intercept(Ff, kh) {
|
|
56692
|
-
if (!Ff.enabled)
|
|
56693
|
-
return kh;
|
|
56694
|
-
if (Ff.pendingReason)
|
|
56695
|
-
return setReasonHeader(kh, Ff.config.reasonHeader, Ff.pendingReason), kh;
|
|
56696
|
-
if (!kh.needReason)
|
|
56697
|
-
return kh;
|
|
56698
|
-
const tAe = await withBusyPaused(Ff, () => askReason(Ff, Ff.config.message));
|
|
56699
|
-
return setReasonHeader(kh, Ff.config.reasonHeader, encodeURIComponent(tAe.trim())), kh;
|
|
56700
|
-
}
|
|
56701
|
-
function installOpTrace(Ff, kh = {}) {
|
|
56702
|
-
var hAe, AAe;
|
|
56703
|
-
if (typeof ((AAe = (hAe = Ff == null ? void 0 : Ff.interceptors) == null ? void 0 : hAe.request) == null ? void 0 : AAe.use) != "function")
|
|
56704
|
-
throw new Error("[op-trace] installOpTrace 需要一个 axios 实例作为第一个参数");
|
|
56705
|
-
const tAe = runtimes.get(Ff);
|
|
56706
|
-
tAe && (eject(Ff, tAe.interceptorId), runtimes.delete(Ff));
|
|
56707
|
-
const { busy: oAe, ...uAe } = kh, pAe = {
|
|
56708
|
-
config: { ...DEFAULTS, ...uAe },
|
|
56709
|
-
busy: oAe,
|
|
56710
|
-
enabled: !0,
|
|
56711
|
-
pendingReason: null,
|
|
56712
|
-
interceptorId: null
|
|
56713
|
-
};
|
|
56714
|
-
return runtimes.set(Ff, pAe), pAe.interceptorId = Ff.interceptors.request.use((vAe) => intercept(pAe, vAe)), {
|
|
56715
|
-
isEnabled: () => pAe.enabled,
|
|
56716
|
-
enable(vAe) {
|
|
56717
|
-
return pAe.enabled = vAe, vAe || (pAe.pendingReason = null), this;
|
|
56718
|
-
},
|
|
56719
|
-
destroy() {
|
|
56720
|
-
pAe.pendingReason = null, pAe.enabled = !1, eject(Ff, pAe.interceptorId), pAe.interceptorId = null, runtimes.delete(Ff);
|
|
56721
|
-
},
|
|
56722
|
-
async confirmReason() {
|
|
56723
|
-
const vAe = await askReason(pAe, pAe.config.batchMessage);
|
|
56724
|
-
return pAe.pendingReason = encodeURIComponent(vAe.trim()), vAe;
|
|
56725
|
-
},
|
|
56726
|
-
clearReason: () => {
|
|
56727
|
-
pAe.pendingReason = null;
|
|
56728
|
-
}
|
|
56729
|
-
};
|
|
56730
|
-
}
|
|
56731
|
-
const _sfc_main$l = defineComponent({
|
|
56636
|
+
const __unplugin_components_1$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["render", _sfc_render$k], ["__scopeId", "data-v-50ed1da4"]]), _sfc_main$l = defineComponent({
|
|
56732
56637
|
name: "Form",
|
|
56733
56638
|
components: { SearchTab: __unplugin_components_1$1, uploadComp: UploadComp },
|
|
56734
56639
|
props: {
|
|
@@ -56839,7 +56744,7 @@ const _sfc_main$l = defineComponent({
|
|
|
56839
56744
|
url: oAe.state._BASE_URL + pAe.url,
|
|
56840
56745
|
[MAe]: typeof FAe == "object" ? FAe : pAe.formData || {},
|
|
56841
56746
|
method: pAe.method || "POST",
|
|
56842
|
-
|
|
56747
|
+
traceAction: pAe.traceAction
|
|
56843
56748
|
}).then((kAe) => {
|
|
56844
56749
|
if (pAe.submitAfter) {
|
|
56845
56750
|
let _Ae = {};
|
|
@@ -56871,7 +56776,7 @@ const _sfc_main$l = defineComponent({
|
|
|
56871
56776
|
fileUrlInfo: bAe
|
|
56872
56777
|
};
|
|
56873
56778
|
}
|
|
56874
|
-
}),
|
|
56779
|
+
}), Form_vue_vue_type_style_index_0_scoped_201e7fe1_lang = "", Form_vue_vue_type_style_index_1_lang = "", _hoisted_1$m = {
|
|
56875
56780
|
key: 0,
|
|
56876
56781
|
class: "mask"
|
|
56877
56782
|
}, _hoisted_2$h = ["innerHTML"];
|
|
@@ -57274,7 +57179,7 @@ function _sfc_render$j(Ff, kh, tAe, oAe, uAe, pAe) {
|
|
|
57274
57179
|
_: 3
|
|
57275
57180
|
}, 8, ["locale"]);
|
|
57276
57181
|
}
|
|
57277
|
-
const Form = /* @__PURE__ */ _export_sfc$1(_sfc_main$l, [["render", _sfc_render$j], ["__scopeId", "data-v-
|
|
57182
|
+
const Form = /* @__PURE__ */ _export_sfc$1(_sfc_main$l, [["render", _sfc_render$j], ["__scopeId", "data-v-201e7fe1"]]), _hoisted_1$l = {
|
|
57278
57183
|
viewBox: "0 0 1024 1024",
|
|
57279
57184
|
width: "1.2em",
|
|
57280
57185
|
height: "1.2em"
|
|
@@ -128976,7 +128881,7 @@ const _sfc_main$h = defineComponent({
|
|
|
128976
128881
|
url: store.state._BASE_URL + eme.url,
|
|
128977
128882
|
[fme]: ime,
|
|
128978
128883
|
method: eme.method || "POST",
|
|
128979
|
-
|
|
128884
|
+
traceAction: eme.traceAction
|
|
128980
128885
|
}).then((Cme) => {
|
|
128981
128886
|
dme[$Ae] = JAe, lme && lme(dme, Cme);
|
|
128982
128887
|
});
|
|
@@ -131820,7 +131725,97 @@ const analyzeResourceLoadTime = () => {
|
|
|
131820
131725
|
}, 5e3), tAe),
|
|
131821
131726
|
(tAe) => Promise.reject(tAe.data)
|
|
131822
131727
|
);
|
|
131823
|
-
},
|
|
131728
|
+
}, DEFAULTS = {
|
|
131729
|
+
title: "操作留痕",
|
|
131730
|
+
message: "请填写操作原因",
|
|
131731
|
+
batchMessage: "请填写本次批量操作原因",
|
|
131732
|
+
placeholder: "必填,将随本次操作记录",
|
|
131733
|
+
confirmText: "确认",
|
|
131734
|
+
cancelText: "取消",
|
|
131735
|
+
reasonHeader: "X-Op-Reason",
|
|
131736
|
+
actionHeader: "X-Op-Action",
|
|
131737
|
+
required: !0,
|
|
131738
|
+
requiredMessage: "请输入操作原因"
|
|
131739
|
+
}, runtimes = /* @__PURE__ */ new WeakMap();
|
|
131740
|
+
function eject(Ff, kh) {
|
|
131741
|
+
var tAe, oAe;
|
|
131742
|
+
kh !== null && ((oAe = (tAe = Ff.interceptors) == null ? void 0 : tAe.request) == null || oAe.eject(kh));
|
|
131743
|
+
}
|
|
131744
|
+
function setHeader(Ff, kh, tAe) {
|
|
131745
|
+
Ff.headers = Ff.headers || {}, Ff.headers[kh] = tAe;
|
|
131746
|
+
}
|
|
131747
|
+
function askReason(Ff, kh) {
|
|
131748
|
+
const { config: tAe } = Ff;
|
|
131749
|
+
return ElMessageBox.prompt(kh, tAe.title, {
|
|
131750
|
+
inputType: "textarea",
|
|
131751
|
+
inputPlaceholder: tAe.placeholder,
|
|
131752
|
+
confirmButtonText: tAe.confirmText,
|
|
131753
|
+
cancelButtonText: tAe.cancelText,
|
|
131754
|
+
...tAe.required && {
|
|
131755
|
+
inputPattern: /\S+/,
|
|
131756
|
+
inputErrorMessage: tAe.requiredMessage
|
|
131757
|
+
}
|
|
131758
|
+
}).then((oAe) => (oAe == null ? void 0 : oAe.value) || "");
|
|
131759
|
+
}
|
|
131760
|
+
async function withBusyPaused(Ff, kh) {
|
|
131761
|
+
var oAe;
|
|
131762
|
+
let tAe = !1;
|
|
131763
|
+
try {
|
|
131764
|
+
(oAe = Ff.busy) != null && oAe.isBusy() && (Ff.busy.setBusy(!1), tAe = !0);
|
|
131765
|
+
} catch {
|
|
131766
|
+
}
|
|
131767
|
+
try {
|
|
131768
|
+
return await kh();
|
|
131769
|
+
} finally {
|
|
131770
|
+
if (tAe)
|
|
131771
|
+
try {
|
|
131772
|
+
Ff.busy.setBusy(!0);
|
|
131773
|
+
} catch {
|
|
131774
|
+
}
|
|
131775
|
+
}
|
|
131776
|
+
}
|
|
131777
|
+
async function intercept(Ff, kh) {
|
|
131778
|
+
if (!Ff.enabled)
|
|
131779
|
+
return kh;
|
|
131780
|
+
const tAe = kh.traceAction;
|
|
131781
|
+
if (tAe && setHeader(kh, Ff.config.actionHeader, tAe), Ff.pendingReason)
|
|
131782
|
+
return setHeader(kh, Ff.config.reasonHeader, Ff.pendingReason), kh;
|
|
131783
|
+
if (!tAe)
|
|
131784
|
+
return kh;
|
|
131785
|
+
const oAe = await withBusyPaused(Ff, () => askReason(Ff, Ff.config.message));
|
|
131786
|
+
return setHeader(kh, Ff.config.reasonHeader, encodeURIComponent(oAe.trim())), kh;
|
|
131787
|
+
}
|
|
131788
|
+
function installOpTrace(Ff, kh = {}) {
|
|
131789
|
+
var hAe, AAe;
|
|
131790
|
+
if (typeof ((AAe = (hAe = Ff == null ? void 0 : Ff.interceptors) == null ? void 0 : hAe.request) == null ? void 0 : AAe.use) != "function")
|
|
131791
|
+
throw new Error("[op-trace] installOpTrace 需要一个 axios 实例作为第一个参数");
|
|
131792
|
+
const tAe = runtimes.get(Ff);
|
|
131793
|
+
tAe && (eject(Ff, tAe.interceptorId), runtimes.delete(Ff));
|
|
131794
|
+
const { busy: oAe, ...uAe } = kh, pAe = {
|
|
131795
|
+
config: { ...DEFAULTS, ...uAe },
|
|
131796
|
+
busy: oAe,
|
|
131797
|
+
enabled: !0,
|
|
131798
|
+
pendingReason: null,
|
|
131799
|
+
interceptorId: null
|
|
131800
|
+
};
|
|
131801
|
+
return runtimes.set(Ff, pAe), pAe.interceptorId = Ff.interceptors.request.use((vAe) => intercept(pAe, vAe)), {
|
|
131802
|
+
isEnabled: () => pAe.enabled,
|
|
131803
|
+
enable(vAe) {
|
|
131804
|
+
return pAe.enabled = vAe, vAe || (pAe.pendingReason = null), this;
|
|
131805
|
+
},
|
|
131806
|
+
destroy() {
|
|
131807
|
+
pAe.pendingReason = null, pAe.enabled = !1, eject(Ff, pAe.interceptorId), pAe.interceptorId = null, runtimes.delete(Ff);
|
|
131808
|
+
},
|
|
131809
|
+
async confirmReason() {
|
|
131810
|
+
const vAe = await askReason(pAe, pAe.config.batchMessage);
|
|
131811
|
+
return pAe.pendingReason = encodeURIComponent(vAe.trim()), vAe;
|
|
131812
|
+
},
|
|
131813
|
+
clearReason: () => {
|
|
131814
|
+
pAe.pendingReason = null;
|
|
131815
|
+
}
|
|
131816
|
+
};
|
|
131817
|
+
}
|
|
131818
|
+
const index = (Ff, kh) => {
|
|
131824
131819
|
var oAe, uAe;
|
|
131825
131820
|
kh.env || console.error('缺少环境变量,请在main.ts中注册"DfsPageConfig"时配置env【app.use(DfsPageConfig, {..., env: {"VITE_NODE_ENV":"production","VITE_APP_API":"https://gateway-tob-is.prod.doublefs.com","BASE_URL":"/","MODE":"production","DEV":false,"PROD":true}})】'), ["getters", "_actions"].forEach((pAe) => {
|
|
131826
131821
|
Object.keys(store[pAe]).forEach((hAe) => {
|