slw 1.0.0-rc.2.6 → 1.0.0-rc.2.8
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveComponent as l, createElementBlock as u, openBlock as s, createBlock as m, createCommentVNode as h, withModifiers as R, normalizeStyle as B, normalizeClass as E, withCtx as o, renderSlot as F, createElementVNode as p, Fragment as M, createVNode as a, mergeProps as k, renderList as Y, toDisplayString as A, resolveDynamicComponent as L, defineAsyncComponent as U, computed as j, unref as D, withDirectives as X, vShow as J } from "vue";
|
|
2
|
-
import { _ as x, d as N, a as S, u as z } from "./index-
|
|
2
|
+
import { _ as x, d as N, a as S, u as z } from "./index-FEcZMezO.js";
|
|
3
3
|
const I = {
|
|
4
4
|
computed: {},
|
|
5
5
|
methods: {
|
|
@@ -54024,7 +54024,12 @@ const _hoisted_1$l3 = {
|
|
|
54024
54024
|
} else if (G.windowId) {
|
|
54025
54025
|
if (beginEdit && await beginEdit(H, gridData.value.rowConfig.keyField, curRegion.value) == !1)
|
|
54026
54026
|
return;
|
|
54027
|
-
|
|
54027
|
+
const oe = Object.assign(H, {
|
|
54028
|
+
buttonId: G._button_id,
|
|
54029
|
+
buttonName: G.name,
|
|
54030
|
+
buttonCode: G.code
|
|
54031
|
+
});
|
|
54032
|
+
showPreView(G.windowId, G.name, oe, {
|
|
54028
54033
|
width: G.openWidth,
|
|
54029
54034
|
height: G.openHeight,
|
|
54030
54035
|
preViewCloseFun: function() {
|
|
@@ -54065,7 +54070,7 @@ const _hoisted_1$l3 = {
|
|
|
54065
54070
|
tableData: getCanEditData(),
|
|
54066
54071
|
rowIndex: H,
|
|
54067
54072
|
childForm: X
|
|
54068
|
-
}, X && Object.keys(X).length > 0 && (K.width = "85vw"), K.params.queryParams !== null && typeof K.params.queryParams < "u" && (K.params.queryParams.unQuery = !0), K.formData._button_id = gridData.value.params.edit_button_id, K._reload = (Z) => reloadRow(Z), rowDbClick(K));
|
|
54073
|
+
}, X && Object.keys(X).length > 0 && (K.width = "85vw"), (K.type == "TREE" || K.type == "TREE_STRUCTURE") && (K.rowIndex = G._INDEX), K.params.queryParams !== null && typeof K.params.queryParams < "u" && (K.params.queryParams.unQuery = !0), K.formData._button_id = gridData.value.params.edit_button_id, K._reload = (Z) => reloadRow(Z), rowDbClick(K));
|
|
54069
54074
|
}, reload = () => {
|
|
54070
54075
|
var G;
|
|
54071
54076
|
(G = getCurRegion()) == null || G.commitProxy("reload");
|
|
@@ -55563,7 +55568,7 @@ const _hoisted_1$l3 = {
|
|
|
55563
55568
|
]);
|
|
55564
55569
|
};
|
|
55565
55570
|
}
|
|
55566
|
-
}, WindowGrid = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-
|
|
55571
|
+
}, WindowGrid = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-b27e1777"]]);
|
|
55567
55572
|
WindowGrid.name = "slw-window-grid";
|
|
55568
55573
|
WindowGrid.install = (G) => {
|
|
55569
55574
|
G.component(WindowGrid.name, WindowGrid);
|
|
@@ -79458,7 +79463,7 @@ const index$g = /* @__PURE__ */ getDefaultExportFromCjs(jsExports), _hoisted_1$l
|
|
|
79458
79463
|
return G.displayLogic && (H = displayLogic(G.displayLogic, {
|
|
79459
79464
|
...formData.value,
|
|
79460
79465
|
...assembleParentData()
|
|
79461
|
-
})), typeof G.code < "u" && G.type != "EDIT" && G.type != "DELETE" && G.type != "NEW" && !(uploadConfig.value.isHaveImgField && G.type == "PIC_UPLOAD") && H;
|
|
79466
|
+
})), typeof G.code < "u" && G.type != "EDIT" && G.type != "DELETE" && G.type != "NEW" && !(uploadConfig.value.isHaveImgField && G.type == "PIC_UPLOAD") && G.visible && H;
|
|
79462
79467
|
})), formSelectMap = computed(() => {
|
|
79463
79468
|
let G = {};
|
|
79464
79469
|
return formConfig.value.columns.forEach((H) => {
|
|
@@ -79511,29 +79516,29 @@ const index$g = /* @__PURE__ */ getDefaultExportFromCjs(jsExports), _hoisted_1$l
|
|
|
79511
79516
|
return formConfig.value.columns.filter((X) => X.displayForm).length == 0 && (G = !0), G;
|
|
79512
79517
|
}), computeTitleWidth = computed(() => formConfig.value.params.formTitleWidth ? formConfig.value.params.formTitleWidth : "115"), computeItemGroup = computed(() => (G) => formConfig.value.params.setColumnsGroup ? G.children : formConfig.value.columns);
|
|
79513
79518
|
onMounted(async () => {
|
|
79514
|
-
var H, X, Q, K, Z;
|
|
79519
|
+
var H, X, Q, K, Z, ee, te;
|
|
79515
79520
|
if (formConfig.value.params.linkUrl) return;
|
|
79516
79521
|
formLoading.value = !0, formConfig.value.params.columnsGroup = [
|
|
79517
79522
|
{
|
|
79518
79523
|
title: "",
|
|
79519
79524
|
children: []
|
|
79520
79525
|
}
|
|
79521
|
-
], formConfig.value.columns.forEach((
|
|
79522
|
-
|
|
79526
|
+
], formConfig.value.columns.forEach((ne, re, oe) => {
|
|
79527
|
+
ne.hasOwnProperty("field") && !ne.hasOwnProperty("treeNode") && (ne.events.change = onFieldChange, ne.events.keyup = onFieldEnter, ne.events.click = onFieldClick), (ne == null ? void 0 : ne.dataType) === "IMG" && (uploadConfig.value.isHaveImgField = !0, fieldPreviewMap.value[ne.field] = []), (ne == null ? void 0 : ne.dataType) === "FILE" && (uploadConfig.value.isHaveFileField = !0, fieldPreviewMap.value[ne.field] = [], fileUploadFinishedMap.value[ne.field] = !0);
|
|
79523
79528
|
}), await evalEvent(formConfig.value.params.formEvents.dataInit, "FORM", "表单数据初始化前"), formConfig.value.params.parentRegionId && addGridClickEvent(rowClickEmitFun);
|
|
79524
79529
|
let G = !0;
|
|
79525
79530
|
if (formConfig.value.formData) {
|
|
79526
79531
|
formData.value = formConfig.value.formData, G = formConfig.value.openType === "new", formConfig.value.openType === "view" && (formConfig.value.columns = XEUtils$1.clone(formConfig.value.columns, !0));
|
|
79527
|
-
for (const
|
|
79528
|
-
formConfig.value.openType === "view" && ((H =
|
|
79532
|
+
for (const ne of formConfig.value.columns)
|
|
79533
|
+
formConfig.value.openType === "view" && ((H = ne.itemRender) == null ? void 0 : H.name) == "ElInput" && (ne.itemRender.props.readonly = !0), ne.dataType === "EDITOR" ? formData.value[ne.field] == null ? formData.value[ne.field] = "" : ne.language == "javascript" && (formData.value[ne.field] = jsExports.js_beautify(formData.value[ne.field], codeBeautifyConfig)) : (X = ne.itemRender) != null && X.name.includes("Select") && ne.itemRender.props.multiple ? formData.value[ne.field] == "" ? formData.value[ne.field] = [] : typeof formData.value[ne.field] == "string" && (formData.value[ne.field] = (Q = formData.value[ne.field]) == null ? void 0 : Q.split(",")) : ne.dataType === "FILE" || ne.dataType === "IMG" ? formData.value[ne.field] = [] : ((K = ne.itemRender) == null ? void 0 : K.name) === "ElInputNumber" && (formData.value[ne.field] = 0);
|
|
79529
79534
|
} else {
|
|
79530
|
-
for (const
|
|
79531
|
-
|
|
79535
|
+
for (const ne of formConfig.value.columns)
|
|
79536
|
+
ne.type !== "seq" && ne.type !== "checkbox" && (formData.value[ne.field] = "", (Z = ne.itemRender) != null && Z.name.includes("Select") && ne.itemRender.props.multiple ? formData.value[ne.field] = formData.value[ne.field] == "" ? [] : (ee = formData.value[ne.field]) == null ? void 0 : ee.split(",") : ne.dataType === "FILE" || ne.dataType === "IMG" ? formData.value[ne.field] = [] : ((te = ne.itemRender) == null ? void 0 : te.name) === "ElInputNumber" && (formData.value[ne.field] = 0));
|
|
79532
79537
|
formConfig.value.formData = formData.value;
|
|
79533
79538
|
}
|
|
79534
|
-
uploadConfig.value.dataId = formData.value[formConfig.value.rowConfig.keyField], uploadConfig.value.regionId = formConfig.value.params._region_id, uploadConfig.value.isHavePicUploadBtn = formConfig.value.params.isHavePicUploadBtn, uploadConfig.value.openType = formConfig.value.openType, uploadConfig.value.config = formConfig.value.params.pictureUploadConfig, computeNewLine(), formData.value._region_id = formConfig.value.params._region_id, await formInitData(formData.value, formConfig.value.params._region_id, G), form.value.params = formConfig.value.params, formConfig.value.params.queryParams && Object.keys(formConfig.value.params.queryParams).length > 0 && formConfig.value.params.queryParams.unQuery !== !0 && searchData(formConfig.value.params.queryParams), formConfig.value.columns.map((
|
|
79535
|
-
var
|
|
79536
|
-
|
|
79539
|
+
uploadConfig.value.dataId = formData.value[formConfig.value.rowConfig.keyField], uploadConfig.value.regionId = formConfig.value.params._region_id, uploadConfig.value.isHavePicUploadBtn = formConfig.value.params.isHavePicUploadBtn, uploadConfig.value.openType = formConfig.value.openType, uploadConfig.value.config = formConfig.value.params.pictureUploadConfig, computeNewLine(), formData.value._region_id = formConfig.value.params._region_id, await formInitData(formData.value, formConfig.value.params._region_id, G), form.value.params = formConfig.value.params, formConfig.value.params.queryParams && Object.keys(formConfig.value.params.queryParams).length > 0 && formConfig.value.params.queryParams.unQuery !== !0 && searchData(formConfig.value.params.queryParams), formConfig.value.columns.map((ne) => {
|
|
79540
|
+
var re;
|
|
79541
|
+
ne.hasOwnProperty("field") && !ne.hasOwnProperty("treeNode") && (fieldColumnMap.value[ne.field] = ne), (re = ne == null ? void 0 : ne.itemRender) != null && re.props && (ne.itemRender.props.title = computed(() => formData.value["_" + ne.field + "_NAME"]));
|
|
79537
79542
|
}), !formConfig.value.params.linkUrl && (formConfig.value.type === "FORM" ? (regionMap.value[formConfig.value.params.code + "-" + preTag.value] = form.value, regionMap.value[formConfig.value.params.code] = form.value) : regionMap.value["Edit-" + formConfig.value.params.code + "-" + preTag.value] = form.value, throwFunction(form.value), await evalEvent(formConfig.value.params.formEvents.regionInit, "FORM", "表单页面初始化触发"), nextTick(() => {
|
|
79538
79543
|
formDataClone.value = XEUtils$1.clone(toRaw(formData.value), !0);
|
|
79539
79544
|
}), formLoading.value = !1);
|
|
@@ -80133,6 +80138,13 @@ const index$g = /* @__PURE__ */ getDefaultExportFromCjs(jsExports), _hoisted_1$l
|
|
|
80133
80138
|
formConfig.value.params.pictureUploadConfig = G;
|
|
80134
80139
|
}, onloadFile = () => {
|
|
80135
80140
|
formDataClone.value = XEUtils$1.clone(toRaw(formData.value), !0);
|
|
80141
|
+
}, setButtonDisplay = (G, H) => {
|
|
80142
|
+
formConfig.value.toolbarConfig.buttons.forEach((X) => {
|
|
80143
|
+
if (X.name == G) {
|
|
80144
|
+
X.visible = H;
|
|
80145
|
+
return;
|
|
80146
|
+
}
|
|
80147
|
+
});
|
|
80136
80148
|
}, throwFunction = (G) => {
|
|
80137
80149
|
G.getData = () => getData(), G.submitData = () => submitData(), G.getValue = (H) => getValue(H), G.setValue = (H, X, Q) => setValue(H, X, Q), G.checkSubmitData = () => checkSubmitData(), G.searchData = (H) => searchData(H), G.search = (H) => searchData(H), G.displayFormItem = (H, X) => displayFormItem(H, X), G.resetForm = () => resetForm(), G.clearData = () => clearData(), G.setFieldName = (H, X) => setFieldName(H, X), G.setFormItemProperty = (H, X, Q) => setFormItemProperty(H, X, Q), G.getTableFieldSelectData = (H) => getTableFieldSelectData(H), G.setFormSelectOption = (H, X) => setFormSelectOption(H, X), G.closeDrawer = () => {
|
|
80138
80150
|
closeDrawer();
|
|
@@ -80456,7 +80468,7 @@ const index$g = /* @__PURE__ */ getDefaultExportFromCjs(jsExports), _hoisted_1$l
|
|
|
80456
80468
|
]);
|
|
80457
80469
|
};
|
|
80458
80470
|
}
|
|
80459
|
-
}, WindowForm = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-
|
|
80471
|
+
}, WindowForm = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-27356e46"]]);
|
|
80460
80472
|
WindowForm.name = "slw-window-form";
|
|
80461
80473
|
WindowForm.install = (G) => {
|
|
80462
80474
|
G.component(WindowForm.name, WindowForm);
|
|
@@ -93406,7 +93418,7 @@ const _hoisted_1$kT = { class: "form-widget-container" }, _hoisted_2$kS = { clas
|
|
|
93406
93418
|
emits: ["update:type", "update:rootLayout", "update:viewData", "update:rowData"],
|
|
93407
93419
|
setup(G, { emit: H }) {
|
|
93408
93420
|
const X = defineAsyncComponent(
|
|
93409
|
-
() => import("./index-
|
|
93421
|
+
() => import("./index-57C_l8Ot.js")
|
|
93410
93422
|
), Q = G, K = H;
|
|
93411
93423
|
let Z = useVModel(Q, "type", K), ee = useVModel(Q, "rootLayout", K), te = useVModel(Q, "viewData", K), ne = useVModel(Q, "rowData", K), re = ref$1(0), oe = ref$1(null);
|
|
93412
93424
|
oe.value = createDesigner();
|
|
@@ -94428,10 +94440,65 @@ const _hoisted_1$kS = { class: "slw-config-window-container" }, _hoisted_2$kR =
|
|
|
94428
94440
|
}, beforeHideMethod = async (G) => {
|
|
94429
94441
|
const H = formConfig.value.openType === "edit" || formConfig.value.openType === "new", X = xForm.value.validateDataChg(), Q = G.type === "close";
|
|
94430
94442
|
H && X && Q && await $vxeConfirm("当前页面数据有更改,是否保存数据?", void 0, { zIndex: 3e3 }) === "confirm" ? saveData(!0) : saveDataBtnLoading.value = !1, exeEndEdit();
|
|
94431
|
-
}
|
|
94432
|
-
|
|
94443
|
+
};
|
|
94444
|
+
function updateTableDataWithFormData(G, H) {
|
|
94445
|
+
if (!H || H._INDEX === void 0 || H._INDEX === null)
|
|
94446
|
+
return console.warn("formData does not have _INDEX property"), !1;
|
|
94447
|
+
const X = H._INDEX, Q = findNodeByIndex(G, X);
|
|
94448
|
+
if (!Q)
|
|
94449
|
+
return console.warn(`Node with _INDEX ${X} not found in tableData`), !1;
|
|
94450
|
+
const K = Q._CHILDS;
|
|
94451
|
+
for (const Z in H)
|
|
94452
|
+
Z !== "_CHILDS" && (Q[Z] = H[Z]);
|
|
94453
|
+
return K && (!H._CHILDS || H._CHILDS.length === 0) ? Q._CHILDS = K : H._CHILDS && H._CHILDS.length > 0 && (Q._CHILDS = H._CHILDS), !0;
|
|
94454
|
+
}
|
|
94455
|
+
function findNodeByIndex(G, H) {
|
|
94456
|
+
if (!Array.isArray(G)) return null;
|
|
94457
|
+
for (const X of G) {
|
|
94458
|
+
if (X._INDEX === H)
|
|
94459
|
+
return X;
|
|
94460
|
+
if (X._CHILDS && X._CHILDS.length > 0) {
|
|
94461
|
+
const Q = findNodeByIndex(X._CHILDS, H);
|
|
94462
|
+
if (Q)
|
|
94463
|
+
return Q;
|
|
94464
|
+
}
|
|
94465
|
+
}
|
|
94466
|
+
return null;
|
|
94467
|
+
}
|
|
94468
|
+
function getAdjacentData(G, H, X) {
|
|
94469
|
+
const Q = ["prev", "next"];
|
|
94470
|
+
if (!Q.includes(X))
|
|
94471
|
+
throw new Error(`Invalid direction: ${X}. Must be one of: ${Q.join(", ")}`);
|
|
94472
|
+
function K(re, oe = []) {
|
|
94473
|
+
if (!Array.isArray(re)) return oe;
|
|
94474
|
+
for (const ae of re)
|
|
94475
|
+
oe.push(ae), ae._CHILDS && ae._CHILDS.length > 0 && K(ae._CHILDS, oe);
|
|
94476
|
+
return oe;
|
|
94477
|
+
}
|
|
94478
|
+
const Z = K(G);
|
|
94479
|
+
Z.sort((re, oe) => re._INDEX - oe._INDEX);
|
|
94480
|
+
const ee = H == null ? void 0 : H._INDEX;
|
|
94481
|
+
if (ee == null)
|
|
94482
|
+
return Z.find((re) => re._INDEX === 0);
|
|
94483
|
+
let te;
|
|
94484
|
+
X === "next" ? te = ee + 1 : X === "prev" && (te = ee - 1);
|
|
94485
|
+
let ne = Z.find((re) => re._INDEX === te);
|
|
94486
|
+
return ne || (X === "next" ? Z.find((re) => re._INDEX === 0) : X === "prev" ? Z[Z.length - 1] : null);
|
|
94487
|
+
}
|
|
94488
|
+
const editPreData = () => {
|
|
94489
|
+
if (formConfig.value.type == "TREE" || formConfig.value.type == "TREE_STRUCTURE") {
|
|
94490
|
+
formConfig.value.formData._button_id = formConfig.value.params.edit_button_id, isAutoSave.value && (updateTableDataWithFormData(formConfig.value.tableData, formConfig.value.formData), saveData(!1));
|
|
94491
|
+
const G = getAdjacentData(formConfig.value.tableData, formConfig.value.formData, "prev");
|
|
94492
|
+
formConfig.value.formData = XEUtils$1.clone(toRaw(G), !0);
|
|
94493
|
+
} else
|
|
94494
|
+
isAutoSave.value && (formConfig.value.tableData[formConfig.value.rowIndex] = formConfig.value.formData, saveData(!1)), --formConfig.value.rowIndex < 0 && (formConfig.value.rowIndex = formConfig.value.tableData.length - 1), formConfig.value.formData = formConfig.value.tableData[formConfig.value.rowIndex];
|
|
94433
94495
|
}, editAfterData = () => {
|
|
94434
|
-
|
|
94496
|
+
if (formConfig.value.type == "TREE" || formConfig.value.type == "TREE_STRUCTURE") {
|
|
94497
|
+
formConfig.value.formData._button_id = formConfig.value.params.edit_button_id, isAutoSave.value && (updateTableDataWithFormData(formConfig.value.tableData, formConfig.value.formData), saveData(!1));
|
|
94498
|
+
const G = getAdjacentData(formConfig.value.tableData, formConfig.value.formData, "next");
|
|
94499
|
+
formConfig.value.formData = XEUtils$1.clone(toRaw(G), !0);
|
|
94500
|
+
} else
|
|
94501
|
+
isAutoSave.value && (formConfig.value.tableData[formConfig.value.rowIndex] = formConfig.value.formData, saveData(!1)), ++formConfig.value.rowIndex >= formConfig.value.tableData.length && (formConfig.value.rowIndex = 0), formConfig.value.formData = formConfig.value.tableData[formConfig.value.rowIndex];
|
|
94435
94502
|
}, settPageHeight = () => {
|
|
94436
94503
|
props.height ? props.height.indexOf("%") > 0 ? layoutHeight.value = document.documentElement.clientHeight / 100 * parseInt(props.height) : layoutHeight.value = parseInt(props.height) : layoutHeight.value = document.documentElement.clientHeight;
|
|
94437
94504
|
}, jumpDesign = async (G, H, X) => {
|
|
@@ -94761,7 +94828,7 @@ const _hoisted_1$kS = { class: "slw-config-window-container" }, _hoisted_2$kR =
|
|
|
94761
94828
|
]);
|
|
94762
94829
|
};
|
|
94763
94830
|
}
|
|
94764
|
-
}, WindowIndex = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
94831
|
+
}, WindowIndex = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-0719b940"]]);
|
|
94765
94832
|
WindowIndex.name = "slw-window-index";
|
|
94766
94833
|
WindowIndex.install = (G) => {
|
|
94767
94834
|
G.component(WindowIndex.name, WindowIndex);
|
|
@@ -222745,7 +222812,7 @@ function reConsole() {
|
|
|
222745
222812
|
}
|
|
222746
222813
|
}
|
|
222747
222814
|
console.info(
|
|
222748
|
-
`%cSLW %cVer 1.0.0-rc.2.
|
|
222815
|
+
`%cSLW %cVer 1.0.0-rc.2.8%c
|
|
222749
222816
|
%c指引文档:%chttp://slwdoc.js.sforcecon.com:5900/%c
|
|
222750
222817
|
%c启光文档:%chttp://docs.js.sforcecon.com:5900/view`,
|
|
222751
222818
|
"color:#409EFF;font-size: 22px;font-weight:bolder;text-shadow: 2px 2px 4px #84c1ff;",
|
package/lib/index.js
CHANGED