@gct-paas/excel 0.1.39-beta.40 → 0.1.39-beta.41
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/{BaseComponent-DidQ_7a_.js → BaseComponent-hWfUDepU.js} +1 -1
- package/dist/{barcode-design-B8Wx_KI7.js → barcode-design-CH7C0nTV.js} +1 -1
- package/dist/base/index.es.js +4 -4
- package/dist/{diagonal-design-Be5dGB14.js → diagonal-design-CKLfmzt9.js} +1 -1
- package/dist/{dynamic-table-action-Bmdi7alJ.js → dynamic-table-action-Dhx1ZQSa.js} +2 -2
- package/dist/excel.css +62 -11
- package/dist/{exceljs.min-wH4A-2gc.js → exceljs.min-BNsMIPFn.js} +1 -1
- package/dist/{font-editor-B57ztQI3.js → font-editor-CHZPtUHX.js} +1 -1
- package/dist/{index-Bx6NpFE9.js → index-B863k7Jl.js} +3 -3
- package/dist/{index-D7ovxfg9.js → index-BNKKUueq.js} +1 -1
- package/dist/{index-aGcBuVIb.js → index-BTr11l_g.js} +1 -1
- package/dist/{index-CF39ggy5.js → index-BVSnhxY1.js} +1 -1
- package/dist/{index-CC2qut8m.js → index-BZPA_AiO.js} +2 -2
- package/dist/{index-jvotzKm2.js → index-BfIS3NOa.js} +5 -2
- package/dist/{index-CqqJ3his.js → index-BgV92L3Y.js} +1 -1
- package/dist/{index-C8iDQtRr.js → index-Bj3c4vZy.js} +1 -1
- package/dist/{index-PFPhIStD.js → index-Bua1ArJ5.js} +1 -1
- package/dist/{index-NNGcsmsY.js → index-CDRNOYDd.js} +2 -2
- package/dist/{index-DT3EoOVp.js → index-C__SKZMl.js} +2 -2
- package/dist/{index-Bserup-h.js → index-Ca0fy776.js} +1 -1
- package/dist/{index-BNIABvw9.js → index-CbXJ1XDJ.js} +2 -2
- package/dist/{index-B0Vbs0k9.js → index-CfvZdYSY.js} +1 -1
- package/dist/{index-BMrT49e4.js → index-CiqInN9G.js} +1 -1
- package/dist/{index-BU9aiCZH.js → index-Cy4bHDfG.js} +1 -1
- package/dist/{index-B57o3Egn.js → index-D1bE-oJR.js} +259 -147
- package/dist/{index-B_f2z7Fg.js → index-D7kir0tU.js} +1 -1
- package/dist/{index-4GNzFs_7.js → index-DR6T7C4O.js} +1 -1
- package/dist/{index-BK6FsaFW.js → index-DnM4LcB4.js} +1 -1
- package/dist/{index-DM7iO1vz.js → index-DnOwWeey.js} +1 -1
- package/dist/{index-DQBCQIUX.js → index-ICNCCzD2.js} +1 -1
- package/dist/{index-D0drNdqI.js → index-LVofttI7.js} +2 -2
- package/dist/{index-BKkc9PaW.js → index-cnZ4ogvg.js} +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{pagination-design-CcNfWRta.js → pagination-design-BjxLbj93.js} +1 -1
- package/dist/paper-widget-design-Cy2MxlCk.js +4 -0
- package/dist/{print-runtime-instance-wqeNIemM.js → print-runtime-instance-THb92xUW.js} +1 -1
- package/dist/{print-snapshot-renderer-CPFIw63J.js → print-snapshot-renderer-4jQFaAjJ.js} +3 -3
- package/dist/{qrcode-design-BjA8SQXf.js → qrcode-design-DM9kEawx.js} +1 -1
- package/dist/seal-design-C5P3oQIa.js +4 -0
- package/dist/{single-field-drop-BA3lBMcJ.js → single-field-drop-BAiIyb2u.js} +1 -1
- package/dist/src/online-form/src/views/designer/modules/xlsx-import-summary.vue.d.ts +11 -0
- package/dist/src/online-form/src/views/designer/utils/cell-field-placements.d.ts +12 -0
- package/dist/src/online-form/src/views/designer/utils/xlsx-parser.d.ts +9 -3
- package/dist/{sub-table-factory-BP2eBKGz.js → sub-table-factory-_mm1iwau.js} +1 -1
- package/dist/{text-design-CZkgq9OB.js → text-design-DfdH_3_b.js} +1 -1
- package/dist/{trace-like-wrapper-CuKzkv-c.js → trace-like-wrapper-D6lJ8e-H.js} +4 -1
- package/dist/{value-editor.vue_vue_type_style_index_0_lang-Vw4MwIVM.js → value-editor.vue_vue_type_style_index_0_lang-BmQGrlz8.js} +1 -1
- package/dist/{widget-barcode-W5MQVGy_.js → widget-barcode-By9P2d-R.js} +2 -2
- package/dist/{widget-diagonal-BYx_rmij.js → widget-diagonal-DMNfA-Tt.js} +2 -2
- package/dist/{widget-image-Btu_5z7c.js → widget-image-YM9YaMb-.js} +1 -1
- package/dist/{widget-line-B7NFA4CC.js → widget-line-Dl3TIfBO.js} +1 -1
- package/dist/{widget-pagination-DLS5-U_l.js → widget-pagination-9XxvQDIw.js} +2 -2
- package/dist/{widget-power-BTR1uZ_X.js → widget-power-A96VVJDG.js} +2 -2
- package/dist/{widget-qrcode-CJmioStY.js → widget-qrcode-DWseHVIM.js} +2 -2
- package/dist/{widget-rangelimit-DfuNVDsE.js → widget-rangelimit-DK8oOmC_.js} +2 -2
- package/dist/{widget-serialnumber-KeVYJBn8.js → widget-serialnumber-pue8WfA9.js} +1 -1
- package/dist/{widget-text-D6PjB04d.js → widget-text-B9O9UYK7.js} +3 -3
- package/dist/{widget-timediff-CSKXudmS.js → widget-timediff-PwNxXBrF.js} +1 -1
- package/package.json +1 -1
- package/dist/paper-widget-design-Dbo_qYm8.js +0 -4
- package/dist/seal-design-B2qsDyWv.js +0 -4
|
@@ -4,11 +4,11 @@ import { g as getAllDataProfiles, i as isDataTableProfile, a as getProfile, b as
|
|
|
4
4
|
import { range, cloneDeep, get as get$3, merge, isEmpty, zip, pick, omit, has, debounce, isNil, times, clone as clone$3, differenceBy, last, mapValues, set as set$2, hasIn, isEqual } from "lodash-es";
|
|
5
5
|
import dayjs from "dayjs";
|
|
6
6
|
import * as Antd from "ant-design-vue";
|
|
7
|
-
import { message, Modal, Empty, InputSearch, Cascader, ConfigProvider, Tooltip as Tooltip$1, Input, Tree, Transfer, Select, Tag, AutoComplete, TimePicker, DatePicker, Textarea, TreeSelect, CheckboxGroup, Checkbox, Radio, RadioGroup
|
|
8
|
-
import { M as MAX_RUNTIME_SHEETS, a as MAX_RUNTIME_SHEET_TITLE_LENGTH,
|
|
9
|
-
import { S as SEARCH_SEVICE, V as VersionSelect, C as CloseOutlined, E as EmptyImg$2, _ as _sfc_main$
|
|
7
|
+
import { message, Modal, Alert, Empty, InputSearch, Cascader, ConfigProvider, Tooltip as Tooltip$1, Input, Tree, Transfer, Select, Tag, AutoComplete, TimePicker, DatePicker, Textarea, TreeSelect, CheckboxGroup, Checkbox, Radio, RadioGroup } from "ant-design-vue";
|
|
8
|
+
import { M as MAX_RUNTIME_SHEETS, a as MAX_RUNTIME_SHEET_TITLE_LENGTH, g as getBusinessFieldKey, b as MULTI_SHEET_SCHEMA_VERSION, n as normalizeGridColumnWidth, c as getParseFormulaVarInfos, d as createRuntimeDocumentV2, e as clampSealPosition, f as normalizeSealDiameter, h as normalizeFieldWidth, D as DEFAULT_BOOLEAN_FIELD_WIDTH, i as isCellAutoLineBreak, B as BorderTD, u as useFormTmplConfig, j as normalizeHistoricalBusinessRow, k as DeviceLinkTmplUtil, l as normalizeAIOcrTmpl, m as useWidgetStaticAttrs, o as useRuntimeInstanceServices, s as setSelectValidatorId, p as setSelectAnnotationId, q as useRuntimeRowState, r as getObjectBomMaterialLotQuery, t as buildObjectLotExtraQuery, v as resolveObjectFieldKeys, w as MaterialConsumptionPatternEnum, x as validateObjectBomForScan, y as resolveObjectBomEntry, z as runWithFillProduct, A as useNocodeFormWidget, C as applyConsumeObjectTraceChange, E as getObjectBomProductQuery, F as EMPTY_PRODUCT_VERSION_ID, G as normalizeHistoricalAutofillRow, N as NCB_PROVIDE, H as readSealValue, I as isSealStamped, J as stampSealValue, K as isValidSealValue, L as clearSealValue, O as parseRuntimeFieldPath, P as calculateFormula, Q as useStyles, R as useDependency, S as useFieldPresentation, T as useRuntimeEditorFlusher, U as RuntimeFormStateStore, V as createRuntimeInstanceContext, W as RuntimeInstanceRegistry, X as ScanParamType, Y as RequiredQtyCalcRule, Z as registerFormulaFuncs, _ as moveSealValue, $ as DocumentPaper, a0 as DynamicTableAction, a1 as _sfc_main$6w } from "./dynamic-table-action-Dhx1ZQSa.js";
|
|
9
|
+
import { S as SEARCH_SEVICE, V as VersionSelect, C as CloseOutlined, E as EmptyImg$2, _ as _sfc_main$6u, P as ProductTypeEnum } from "./online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-DOYhOffQ.js";
|
|
10
10
|
import { I as Icon$1, w as warning, u as useInsertStyles, s as svgBaseProps, a as useNamespace } from "./AntdIcon-DCIaV352.js";
|
|
11
|
-
import { u as useWebUpload, i as initWebPaasUploadApis, a as useThrottleFn, d as defaultWindow, n as noop, b as useEventListener, c as isIOS, e as unrefElement, r as require$$0, U as Uploader, f as useIntersectionObserver, g as cacheAdapter, w as watchDebounced, A as AddRuleBtn, M as ModalWrapper, F as FormFieldSelect, o as onClickOutside$1, _ as _sfc_main$
|
|
11
|
+
import { u as useWebUpload, i as initWebPaasUploadApis, a as useThrottleFn, d as defaultWindow, n as noop, b as useEventListener, c as isIOS, e as unrefElement, r as require$$0, U as Uploader, f as useIntersectionObserver, g as cacheAdapter, w as watchDebounced, A as AddRuleBtn, M as ModalWrapper, F as FormFieldSelect, o as onClickOutside$1, _ as _sfc_main$6v, h as initWebNocodeAdapter } from "./index-DThgFjEo.js";
|
|
12
12
|
import { useFormBaseModal, FormBaseModalPlugin } from "@gct-paas/form-base";
|
|
13
13
|
import { Tooltip, Grid, Table, Column, Icon as Icon$2, Edit, Validator, VxeGrid } from "vxe-table";
|
|
14
14
|
import { u as useFormModel, F as FormModelController } from "./mb-render-FUO_-FXR.js";
|
|
@@ -1931,7 +1931,7 @@ function openWindow(url, opt) {
|
|
|
1931
1931
|
const FieldPropLabels = Object.entries(FIELD_PROP_LABEL_MAP);
|
|
1932
1932
|
const FieldTypeLabels = Object.entries(FIELD_TYPE_LABEL_MAP);
|
|
1933
1933
|
async function createWorkbook() {
|
|
1934
|
-
const ExcelJs = (await import("./exceljs.min-
|
|
1934
|
+
const ExcelJs = (await import("./exceljs.min-BNsMIPFn.js").then((n) => n.e)).default;
|
|
1935
1935
|
return new ExcelJs.Workbook();
|
|
1936
1936
|
}
|
|
1937
1937
|
class XlsxParser {
|
|
@@ -1957,66 +1957,95 @@ class XlsxParser {
|
|
|
1957
1957
|
});
|
|
1958
1958
|
return paperFields;
|
|
1959
1959
|
}
|
|
1960
|
-
static async xlsx2Sheets(file, keyList = []) {
|
|
1960
|
+
static async xlsx2Sheets(file, keyList = [], options = {}) {
|
|
1961
1961
|
const workbook = await createWorkbook();
|
|
1962
1962
|
const xlsxData = await workbook.xlsx.load(file);
|
|
1963
|
+
const warnings = [];
|
|
1963
1964
|
const fieldSheetName = $t("sys.onlineForm.formFields");
|
|
1964
1965
|
const fieldSheet = workbook.getWorksheet(fieldSheetName);
|
|
1965
|
-
const
|
|
1966
|
+
const withFields = options.withFields !== false;
|
|
1967
|
+
const fields = withFields && fieldSheet ? XlsxParser.sheetToFields(fieldSheet, keyList, warnings) : null;
|
|
1966
1968
|
const candidates = workbook.worksheets.filter((sheet) => sheet.name !== fieldSheetName);
|
|
1967
1969
|
const hidden = candidates.filter(
|
|
1968
1970
|
(sheet) => sheet.state === "hidden" || sheet.state === "veryHidden"
|
|
1969
1971
|
);
|
|
1970
1972
|
if (hidden.length) {
|
|
1971
|
-
|
|
1973
|
+
warnings.push(`已跳过隐藏工作表:${hidden.map((sheet) => sheet.name).join("、")}。`);
|
|
1972
1974
|
}
|
|
1973
|
-
|
|
1974
|
-
if (
|
|
1975
|
-
|
|
1975
|
+
const visible = candidates.filter((sheet) => !hidden.includes(sheet));
|
|
1976
|
+
if (!visible.length) throw new Error("Excel 中没有可导入的可见工作表");
|
|
1977
|
+
if (visible.length > MAX_RUNTIME_SHEETS) {
|
|
1978
|
+
warnings.push(
|
|
1979
|
+
`最多导入 ${MAX_RUNTIME_SHEETS} 个工作表,已跳过:${visible.slice(MAX_RUNTIME_SHEETS).map((sheet) => sheet.name).join("、")}。`
|
|
1980
|
+
);
|
|
1976
1981
|
}
|
|
1977
1982
|
const names = /* @__PURE__ */ new Set();
|
|
1978
|
-
const
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
);
|
|
1983
|
+
const fieldOwners = /* @__PURE__ */ new Map();
|
|
1984
|
+
const sheets = [];
|
|
1985
|
+
let remainingCells = 3e4;
|
|
1986
|
+
for (const worksheet of visible.slice(0, MAX_RUNTIME_SHEETS)) {
|
|
1987
|
+
if (!remainingCells) {
|
|
1988
|
+
warnings.push(`工作表「${worksheet.name}」未导入:整份表单已达到 30000 个单元格上限。`);
|
|
1989
|
+
continue;
|
|
1990
|
+
}
|
|
1991
|
+
const base = worksheet.name.trim().slice(0, MAX_RUNTIME_SHEET_TITLE_LENGTH) || "工作表";
|
|
1992
|
+
let title = base;
|
|
1993
|
+
let suffix = 2;
|
|
1994
|
+
while (names.has(title)) {
|
|
1995
|
+
const tail = ` (${suffix++})`;
|
|
1996
|
+
title = base.slice(0, MAX_RUNTIME_SHEET_TITLE_LENGTH - tail.length) + tail;
|
|
1997
|
+
}
|
|
1998
|
+
if (title !== worksheet.name) {
|
|
1999
|
+
warnings.push(`工作表「${worksheet.name}」将重命名为「${title}」。`);
|
|
1984
2000
|
}
|
|
1985
|
-
if (names.has(title)) throw new Error(`工作表名称重复:${title}`);
|
|
1986
2001
|
names.add(title);
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
2002
|
+
if (!worksheet.actualRowCount) {
|
|
2003
|
+
warnings.push(`工作表「${title}」为空,将按空白工作表导入。`);
|
|
2004
|
+
}
|
|
2005
|
+
const rowCount = Math.max(1, worksheet.dimensions?.bottom ?? worksheet.rowCount ?? 1);
|
|
2006
|
+
const colCount = Math.max(1, worksheet.dimensions?.right ?? worksheet.columnCount ?? 1);
|
|
2007
|
+
const cols = Math.min(colCount, 75, remainingCells);
|
|
2008
|
+
const rows = Math.min(rowCount, 300, Math.floor(remainingCells / cols));
|
|
2009
|
+
if (rows < rowCount || cols < colCount) {
|
|
2010
|
+
warnings.push(
|
|
2011
|
+
`工作表「${title}」原为 ${rowCount} 行 × ${colCount} 列,仅导入前 ${rows} 行 × ${cols} 列,超出范围的内容将不导入(每表最多 300 行 × 75 列,合计最多 30000 格)。`
|
|
1992
2012
|
);
|
|
1993
2013
|
}
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
2014
|
+
const paper2 = XlsxParser.sheetToPaper(worksheet, xlsxData, { rows, cols });
|
|
2015
|
+
remainingCells -= rows * cols;
|
|
2016
|
+
let formulaCount = 0;
|
|
2017
|
+
worksheet.eachRow((row, rowNumber) => {
|
|
2018
|
+
if (rowNumber > rows) return;
|
|
2019
|
+
row.eachCell((cell, colNumber) => {
|
|
2020
|
+
if (colNumber <= cols && cell.address === cell.master.address && cell.formula) {
|
|
2021
|
+
formulaCount++;
|
|
1999
2022
|
}
|
|
2000
2023
|
});
|
|
2001
2024
|
});
|
|
2002
|
-
if (
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2025
|
+
if (formulaCount) {
|
|
2026
|
+
warnings.push(
|
|
2027
|
+
`工作表「${title}」的 ${formulaCount} 个公式单元格将按静态文本导入,不再自动计算;图片公式不会还原为图片。`
|
|
2028
|
+
);
|
|
2029
|
+
}
|
|
2030
|
+
const paperFields = XlsxParser.extractPaperFields(paper2, fields).filter((field) => {
|
|
2031
|
+
const key = field.fieldKey || field.fieldName;
|
|
2032
|
+
const owner = fieldOwners.get(key);
|
|
2033
|
+
if (owner) {
|
|
2034
|
+
warnings.push(
|
|
2035
|
+
`字段「${field.fieldName || key}」重复出现:保留「${owner}」的首处绑定,「${title}」第 ${field.y} 行第 ${field.x} 列按静态文本导入。`
|
|
2036
|
+
);
|
|
2037
|
+
return false;
|
|
2038
|
+
}
|
|
2039
|
+
fieldOwners.set(key, title);
|
|
2040
|
+
return true;
|
|
2041
|
+
});
|
|
2042
|
+
sheets.push({ title, paper: paper2, paperFields });
|
|
2043
|
+
}
|
|
2044
|
+
return { sheets, fields, warnings };
|
|
2016
2045
|
}
|
|
2017
|
-
static sheetToPaper(paperSheet, xlsxData) {
|
|
2018
|
-
const SheetRowCount = Math.min(paperSheet.dimensions?.bottom ??
|
|
2019
|
-
const SheetColCount = Math.min(paperSheet.dimensions?.right ??
|
|
2046
|
+
static sheetToPaper(paperSheet, xlsxData, size) {
|
|
2047
|
+
const SheetRowCount = size?.rows ?? Math.max(1, Math.min(paperSheet.dimensions?.bottom ?? 1, 300));
|
|
2048
|
+
const SheetColCount = size?.cols ?? Math.max(1, Math.min(paperSheet.dimensions?.right ?? 1, 75));
|
|
2020
2049
|
const paper2 = {};
|
|
2021
2050
|
const { defaultRowHeight, defaultColWidth } = paperSheet.properties;
|
|
2022
2051
|
const defaultRowHeightPx = parseInt(src(`${defaultRowHeight}pt`));
|
|
@@ -2030,7 +2059,7 @@ class XlsxParser {
|
|
|
2030
2059
|
paper2.rows = rows;
|
|
2031
2060
|
const cols = [];
|
|
2032
2061
|
Array(SheetColCount).fill("").forEach((c, i) => {
|
|
2033
|
-
const
|
|
2062
|
+
const width = paperSheet.columns?.[i]?.width;
|
|
2034
2063
|
const _w = width ?? defaultColWidth;
|
|
2035
2064
|
cols.push({
|
|
2036
2065
|
// width: _w === undefined ? 80 : Math.floor(_w * 7 + 5),
|
|
@@ -2046,7 +2075,7 @@ class XlsxParser {
|
|
|
2046
2075
|
Array(SheetColCount).fill("").forEach((_2, colIndex) => {
|
|
2047
2076
|
const cell = paperSheet._rows[rowIndex]._cells[colIndex];
|
|
2048
2077
|
if (!cell) return;
|
|
2049
|
-
const { alignment,
|
|
2078
|
+
const { alignment, fill, font } = cell.style;
|
|
2050
2079
|
const cellName = cell._address;
|
|
2051
2080
|
const cellStyle = {
|
|
2052
2081
|
"text-align": alignment?.horizontal ?? "left",
|
|
@@ -2062,7 +2091,10 @@ class XlsxParser {
|
|
|
2062
2091
|
cells[rowIndex][colIndex].style = cellStyle;
|
|
2063
2092
|
if (cellName !== cell.master.address) return;
|
|
2064
2093
|
let cellValue = "";
|
|
2065
|
-
if (
|
|
2094
|
+
if (cell.formula) {
|
|
2095
|
+
const result = cell.result;
|
|
2096
|
+
cellValue = result == null ? `=${cell.formula}` : typeof result === "object" && "error" in result ? result.error : String(result);
|
|
2097
|
+
} else if (typeof cell.value !== "object") {
|
|
2066
2098
|
cellValue = cell.value;
|
|
2067
2099
|
} else if (typeof cell.text !== "object") {
|
|
2068
2100
|
cellValue = cell.text;
|
|
@@ -2089,10 +2121,10 @@ class XlsxParser {
|
|
|
2089
2121
|
const cell = paperSheet._rows[rowIndex]._cells[colIndex];
|
|
2090
2122
|
if (!cell) return;
|
|
2091
2123
|
const { border } = cell.style;
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2124
|
+
if (border?.top) CellBorder.setTop(colIndex + 1, rowIndex + 1, paper2);
|
|
2125
|
+
if (border?.bottom) CellBorder.setBottom(colIndex + 1, rowIndex + 1, paper2);
|
|
2126
|
+
if (border?.left) CellBorder.setLeft(colIndex + 1, rowIndex + 1, paper2);
|
|
2127
|
+
if (border?.right) CellBorder.setRight(colIndex + 1, rowIndex + 1, paper2);
|
|
2096
2128
|
});
|
|
2097
2129
|
});
|
|
2098
2130
|
const medias = (xlsxData.media ?? []).map((m) => {
|
|
@@ -2114,6 +2146,7 @@ class XlsxParser {
|
|
|
2114
2146
|
const tlNativeCol = range2?.tl?.nativeCol ?? 0;
|
|
2115
2147
|
const brNativeRow = range2?.br?.nativeRow ?? tlNativeRow;
|
|
2116
2148
|
const brNativeCol = range2?.br?.nativeCol ?? tlNativeCol;
|
|
2149
|
+
if (tlNativeRow >= SheetRowCount || tlNativeCol >= SheetColCount) return;
|
|
2117
2150
|
const rowSpan = Math.max(0, brNativeRow - tlNativeRow);
|
|
2118
2151
|
const colSpan = Math.max(0, brNativeCol - tlNativeCol);
|
|
2119
2152
|
const imageLayout = {
|
|
@@ -2160,12 +2193,12 @@ class XlsxParser {
|
|
|
2160
2193
|
* @param sheet
|
|
2161
2194
|
* @returns
|
|
2162
2195
|
*/
|
|
2163
|
-
static sheetToFields(sheet, keyList) {
|
|
2196
|
+
static sheetToFields(sheet, keyList, warnings = []) {
|
|
2164
2197
|
const SheetRowCount = Math.min(sheet.rowCount, 300);
|
|
2165
2198
|
const SheetColCount = Math.min(sheet.columnCount, 10);
|
|
2166
2199
|
const colFieldPropMap = /* @__PURE__ */ new Map();
|
|
2167
2200
|
Array(SheetColCount).fill("").forEach((_, colIndex) => {
|
|
2168
|
-
const cell = sheet._rows[0]
|
|
2201
|
+
const cell = sheet._rows[0]?._cells[colIndex];
|
|
2169
2202
|
const fieldProp = FieldPropLabels.find(
|
|
2170
2203
|
(f) => f[1] === (cell?.text ?? "").replaceAll("*", "").trim()
|
|
2171
2204
|
);
|
|
@@ -2173,6 +2206,12 @@ class XlsxParser {
|
|
|
2173
2206
|
colFieldPropMap.set(colIndex, fieldProp[0]);
|
|
2174
2207
|
}
|
|
2175
2208
|
});
|
|
2209
|
+
if (![...colFieldPropMap.values()].includes("key") || ![...colFieldPropMap.values()].includes("name")) {
|
|
2210
|
+
warnings.push(
|
|
2211
|
+
`工作表「${sheet.name}」缺少字段标识或名称表头,已忽略字段配置,保留表单文本。`
|
|
2212
|
+
);
|
|
2213
|
+
return [];
|
|
2214
|
+
}
|
|
2176
2215
|
const fields = [];
|
|
2177
2216
|
Array(SheetRowCount).fill("").forEach((_, rowIndex) => {
|
|
2178
2217
|
if (rowIndex === 0) return;
|
|
@@ -2184,6 +2223,10 @@ class XlsxParser {
|
|
|
2184
2223
|
field[colFieldPropMap.get(colIndex)] = cell?.text ?? "";
|
|
2185
2224
|
}
|
|
2186
2225
|
});
|
|
2226
|
+
if (!field.key || !field.name) {
|
|
2227
|
+
warnings.push(`字段配置第 ${rowIndex + 1} 行缺少字段标识或名称,已跳过该行。`);
|
|
2228
|
+
return;
|
|
2229
|
+
}
|
|
2187
2230
|
fields.push(field);
|
|
2188
2231
|
});
|
|
2189
2232
|
const cloneKeyList = [...keyList];
|
|
@@ -2259,28 +2302,28 @@ class XlsxParser {
|
|
|
2259
2302
|
}
|
|
2260
2303
|
function asyncImportClassModules() {
|
|
2261
2304
|
const modules = /* @__PURE__ */ Object.assign({
|
|
2262
|
-
"./_field_/auto-complete/index.ts": () => import("./index-
|
|
2263
|
-
"./_field_/datepicker/index.ts": () => import("./index-
|
|
2264
|
-
"./_field_/datetimepicker/index.ts": () => import("./index-
|
|
2265
|
-
"./_field_/department/index.ts": () => import("./index-
|
|
2266
|
-
"./_field_/enum-select/index.ts": () => import("./index-
|
|
2267
|
-
"./_field_/input/index.ts": () => import("./index-
|
|
2268
|
-
"./_field_/inputdouble/index.ts": () => import("./index-
|
|
2269
|
-
"./_field_/inputnumber/index.ts": () => import("./index-
|
|
2270
|
-
"./_field_/rdo-select/index.ts": () => import("./index-
|
|
2271
|
-
"./_field_/seal/index.ts": () => import("./index-
|
|
2272
|
-
"./_field_/select/index.ts": () => import("./index-
|
|
2273
|
-
"./_field_/sign/index.ts": () => import("./index-
|
|
2274
|
-
"./_field_/switch/index.ts": () => import("./index-
|
|
2275
|
-
"./_field_/textarea/index.ts": () => import("./index-
|
|
2276
|
-
"./_field_/timepicker/index.ts": () => import("./index-
|
|
2277
|
-
"./_field_/upload-file/index.ts": () => import("./index-
|
|
2278
|
-
"./_field_/upload-image/index.ts": () => import("./index-
|
|
2279
|
-
"./_field_/userpicker/index.ts": () => import("./index-
|
|
2305
|
+
"./_field_/auto-complete/index.ts": () => import("./index-C__SKZMl.js").then((m) => m["default"]),
|
|
2306
|
+
"./_field_/datepicker/index.ts": () => import("./index-Cy4bHDfG.js").then((m) => m["default"]),
|
|
2307
|
+
"./_field_/datetimepicker/index.ts": () => import("./index-DnOwWeey.js").then((m) => m["default"]),
|
|
2308
|
+
"./_field_/department/index.ts": () => import("./index-ICNCCzD2.js").then((m) => m["default"]),
|
|
2309
|
+
"./_field_/enum-select/index.ts": () => import("./index-CDRNOYDd.js").then((m) => m["default"]),
|
|
2310
|
+
"./_field_/input/index.ts": () => import("./index-Bua1ArJ5.js").then((m) => m["default"]),
|
|
2311
|
+
"./_field_/inputdouble/index.ts": () => import("./index-BNKKUueq.js").then((m) => m["default"]),
|
|
2312
|
+
"./_field_/inputnumber/index.ts": () => import("./index-BTr11l_g.js").then((m) => m["default"]),
|
|
2313
|
+
"./_field_/rdo-select/index.ts": () => import("./index-BZPA_AiO.js").then((m) => m["default"]),
|
|
2314
|
+
"./_field_/seal/index.ts": () => import("./index-LVofttI7.js").then((m) => m["default"]),
|
|
2315
|
+
"./_field_/select/index.ts": () => import("./index-BfIS3NOa.js").then((m) => m["default"]),
|
|
2316
|
+
"./_field_/sign/index.ts": () => import("./index-CfvZdYSY.js").then((m) => m["default"]),
|
|
2317
|
+
"./_field_/switch/index.ts": () => import("./index-B863k7Jl.js").then((m) => m["default"]),
|
|
2318
|
+
"./_field_/textarea/index.ts": () => import("./index-Bj3c4vZy.js").then((m) => m["default"]),
|
|
2319
|
+
"./_field_/timepicker/index.ts": () => import("./index-BVSnhxY1.js").then((m) => m["default"]),
|
|
2320
|
+
"./_field_/upload-file/index.ts": () => import("./index-Ca0fy776.js").then((m) => m["default"]),
|
|
2321
|
+
"./_field_/upload-image/index.ts": () => import("./index-DnM4LcB4.js").then((m) => m["default"]),
|
|
2322
|
+
"./_field_/userpicker/index.ts": () => import("./index-cnZ4ogvg.js").then((m) => m["default"]),
|
|
2280
2323
|
"./_widget_/barcode/index.ts": () => import("./index-Cld2wf77.js").then((m) => m["default"]),
|
|
2281
|
-
"./_widget_/combine-fields/index.ts": () => import("./index-
|
|
2282
|
-
"./_widget_/diagonal/index.ts": () => import("./index-
|
|
2283
|
-
"./_widget_/dyn-value/index.ts": () => import("./index-
|
|
2324
|
+
"./_widget_/combine-fields/index.ts": () => import("./index-DR6T7C4O.js").then((m) => m["default"]),
|
|
2325
|
+
"./_widget_/diagonal/index.ts": () => import("./index-CiqInN9G.js").then((m) => m["default"]),
|
|
2326
|
+
"./_widget_/dyn-value/index.ts": () => import("./index-D7kir0tU.js").then((m) => m["default"]),
|
|
2284
2327
|
"./_widget_/image/index.ts": () => import("./index-B1JboJFx.js").then((m) => m["default"]),
|
|
2285
2328
|
"./_widget_/line/index.ts": () => import("./index-BeFJ_RCt.js").then((m) => m["default"]),
|
|
2286
2329
|
"./_widget_/power/index.ts": () => import("./index-n97S5YRD.js").then((m) => m["default"]),
|
|
@@ -2290,8 +2333,8 @@ function asyncImportClassModules() {
|
|
|
2290
2333
|
"./_widget_/sub-table/index.ts": () => import("./index-2SyQ6xAT.js").then((m) => m["default"]),
|
|
2291
2334
|
"./_widget_/timediff/index.ts": () => import("./index-CDhZoiEf.js").then((m) => m["default"]),
|
|
2292
2335
|
"./paper/index.ts": () => import("./index-BFhX3ACB.js").then((m) => m["default"]),
|
|
2293
|
-
"./td/index.ts": () => import("./index-
|
|
2294
|
-
"./tr/index.ts": () => import("./index-
|
|
2336
|
+
"./td/index.ts": () => import("./index-CbXJ1XDJ.js").then((m) => m["default"]),
|
|
2337
|
+
"./tr/index.ts": () => import("./index-BgV92L3Y.js").then((m) => m["default"])
|
|
2295
2338
|
});
|
|
2296
2339
|
return modules;
|
|
2297
2340
|
}
|
|
@@ -3518,6 +3561,45 @@ class ImgParser {
|
|
|
3518
3561
|
});
|
|
3519
3562
|
}
|
|
3520
3563
|
}
|
|
3564
|
+
function getCellFieldPlacements(paper2) {
|
|
3565
|
+
const placements = [];
|
|
3566
|
+
(paper2.cells ?? []).forEach((row, rowIndex) => {
|
|
3567
|
+
row.forEach((cell, colIndex) => {
|
|
3568
|
+
if (!cell) return;
|
|
3569
|
+
const x = colIndex + 1;
|
|
3570
|
+
const y = rowIndex + 1;
|
|
3571
|
+
const hidden = (paper2.mergedCells ?? []).some(
|
|
3572
|
+
(range2) => range2.l <= x && range2.r >= x && range2.t <= y && range2.b >= y && (range2.l !== x || range2.t !== y)
|
|
3573
|
+
);
|
|
3574
|
+
for (const content of [cell, ...cell.multiFieldsContent ?? []]) {
|
|
3575
|
+
if (content.type && content.type !== CellType.Field) continue;
|
|
3576
|
+
if (content.fieldMeta?.field) placements.push({ cell, content, hidden });
|
|
3577
|
+
}
|
|
3578
|
+
});
|
|
3579
|
+
});
|
|
3580
|
+
return placements;
|
|
3581
|
+
}
|
|
3582
|
+
function clearHiddenCellFieldPlacements(paper2, field) {
|
|
3583
|
+
const key = getBusinessFieldKey({
|
|
3584
|
+
modelKey: field.model ?? field.modelLink,
|
|
3585
|
+
fieldId: field.field
|
|
3586
|
+
});
|
|
3587
|
+
for (const { cell, content, hidden } of getCellFieldPlacements(paper2)) {
|
|
3588
|
+
if (!hidden) continue;
|
|
3589
|
+
const meta = content.fieldMeta;
|
|
3590
|
+
if (getBusinessFieldKey({ modelKey: meta.model ?? meta.modelLink, fieldId: meta.field }) !== key) {
|
|
3591
|
+
continue;
|
|
3592
|
+
}
|
|
3593
|
+
if (content === cell) {
|
|
3594
|
+
cell.type = CellType.Default;
|
|
3595
|
+
cell.fieldMeta = void 0;
|
|
3596
|
+
cell.fieldWidget = void 0;
|
|
3597
|
+
} else {
|
|
3598
|
+
const contents = cell.multiFieldsContent;
|
|
3599
|
+
contents.splice(contents.indexOf(content), 1);
|
|
3600
|
+
}
|
|
3601
|
+
}
|
|
3602
|
+
}
|
|
3521
3603
|
const Default_Apis = {
|
|
3522
3604
|
getFieldMetaList: api.apaas.fieldMeta.getList,
|
|
3523
3605
|
getModelMetaSubModelList: api.apaas.modelComprehensive.getSubModelList,
|
|
@@ -4035,8 +4117,8 @@ function normalizePaperGrid(paper2) {
|
|
|
4035
4117
|
paper2.fixedTables = (Array.isArray(paper2.fixedTables) ? paper2.fixedTables : []).map((table) => normalizeTable(table, rowCount, colCount)).filter((table) => !!table);
|
|
4036
4118
|
return paper2;
|
|
4037
4119
|
}
|
|
4038
|
-
const _hoisted_1$
|
|
4039
|
-
const _sfc_main$
|
|
4120
|
+
const _hoisted_1$3A = { class: "p24px" };
|
|
4121
|
+
const _sfc_main$6t = /* @__PURE__ */ defineComponent({
|
|
4040
4122
|
__name: "add-sheet",
|
|
4041
4123
|
props: {
|
|
4042
4124
|
modal: {},
|
|
@@ -4062,7 +4144,7 @@ const _sfc_main$6s = /* @__PURE__ */ defineComponent({
|
|
|
4062
4144
|
const _component_a_input = resolveComponent("a-input");
|
|
4063
4145
|
const _component_a_form_item = resolveComponent("a-form-item");
|
|
4064
4146
|
const _component_a_form = resolveComponent("a-form");
|
|
4065
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
4147
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3A, [
|
|
4066
4148
|
createVNode(_component_a_form, {
|
|
4067
4149
|
ref_key: "formRef",
|
|
4068
4150
|
ref: formRef,
|
|
@@ -9934,21 +10016,18 @@ const designerSheetsSnapshot = () => sheetsData$1.value.map(({ sheetId, title, p
|
|
|
9934
10016
|
title,
|
|
9935
10017
|
paper: cloneDeep(paper2)
|
|
9936
10018
|
}));
|
|
9937
|
-
function getPlacedFieldCounts(sheets) {
|
|
10019
|
+
function getPlacedFieldCounts(sheets, includeHidden = false) {
|
|
9938
10020
|
const counts = /* @__PURE__ */ new Map();
|
|
9939
10021
|
sheets.forEach((sheet) => {
|
|
9940
|
-
(sheet.paper
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
9950
|
-
}
|
|
9951
|
-
});
|
|
10022
|
+
for (const { content, hidden } of getCellFieldPlacements(sheet.paper)) {
|
|
10023
|
+
if (hidden && !includeHidden) continue;
|
|
10024
|
+
const meta = content.fieldMeta;
|
|
10025
|
+
const key = getBusinessFieldKey({
|
|
10026
|
+
modelKey: meta.model ?? meta.modelLink,
|
|
10027
|
+
fieldId: meta.field
|
|
10028
|
+
});
|
|
10029
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
10030
|
+
}
|
|
9952
10031
|
});
|
|
9953
10032
|
return counts;
|
|
9954
10033
|
}
|
|
@@ -10091,7 +10170,7 @@ const useAllSpreadSheets = () => {
|
|
|
10091
10170
|
return;
|
|
10092
10171
|
}
|
|
10093
10172
|
const res = await window.NocodeAdapter.utils.overlay.modal(
|
|
10094
|
-
_sfc_main$
|
|
10173
|
+
_sfc_main$6t,
|
|
10095
10174
|
{
|
|
10096
10175
|
data,
|
|
10097
10176
|
validator: (rule, value) => {
|
|
@@ -10212,7 +10291,7 @@ const useAllSpreadSheets = () => {
|
|
|
10212
10291
|
}
|
|
10213
10292
|
const names = /* @__PURE__ */ new Set();
|
|
10214
10293
|
let staticCellCount = 0;
|
|
10215
|
-
const savedFieldCounts = getPlacedFieldCounts(cloneSheetsData.value);
|
|
10294
|
+
const savedFieldCounts = getPlacedFieldCounts(cloneSheetsData.value, true);
|
|
10216
10295
|
const fieldOwners = /* @__PURE__ */ new Map();
|
|
10217
10296
|
const subTables = /* @__PURE__ */ new Map();
|
|
10218
10297
|
sheetsData$1.value.forEach((sheet) => {
|
|
@@ -10240,10 +10319,9 @@ const useAllSpreadSheets = () => {
|
|
|
10240
10319
|
}
|
|
10241
10320
|
fieldOwners.set(key, { sheetTitle: previous?.sheetTitle ?? sheet.title, count });
|
|
10242
10321
|
};
|
|
10243
|
-
(sheet.paper
|
|
10244
|
-
registerField(
|
|
10245
|
-
|
|
10246
|
-
});
|
|
10322
|
+
for (const { content, hidden } of getCellFieldPlacements(sheet.paper)) {
|
|
10323
|
+
if (!hidden) registerField(content);
|
|
10324
|
+
}
|
|
10247
10325
|
[...sheet.paper.dynamicTables ?? [], ...sheet.paper.fixedTables ?? []].forEach(
|
|
10248
10326
|
(table) => {
|
|
10249
10327
|
if (!table.field) return;
|
|
@@ -10513,7 +10591,7 @@ const useAllSpreadSheets = () => {
|
|
|
10513
10591
|
removeField: removeField2
|
|
10514
10592
|
};
|
|
10515
10593
|
};
|
|
10516
|
-
const _sfc_main$
|
|
10594
|
+
const _sfc_main$6s = /* @__PURE__ */ defineComponent({
|
|
10517
10595
|
__name: "table-modal",
|
|
10518
10596
|
props: {
|
|
10519
10597
|
type: { default: SubTableType.DEFAULT }
|
|
@@ -10717,7 +10795,7 @@ const _sfc_main$6r = /* @__PURE__ */ defineComponent({
|
|
|
10717
10795
|
};
|
|
10718
10796
|
}
|
|
10719
10797
|
});
|
|
10720
|
-
const _sfc_main$
|
|
10798
|
+
const _sfc_main$6r = /* @__PURE__ */ defineComponent({
|
|
10721
10799
|
__name: "thead-modal",
|
|
10722
10800
|
setup(__props) {
|
|
10723
10801
|
const { selection: selection2, paper: paper2, platformType: platformType2, isTextOnlineForm: isTextOnlineForm2 } = useSpreadSheet();
|
|
@@ -11268,7 +11346,7 @@ function parseHtml(html) {
|
|
|
11268
11346
|
mergedCells
|
|
11269
11347
|
};
|
|
11270
11348
|
}
|
|
11271
|
-
const _sfc_main$
|
|
11349
|
+
const _sfc_main$6q = /* @__PURE__ */ defineComponent({
|
|
11272
11350
|
__name: "field-edit-modal",
|
|
11273
11351
|
props: {
|
|
11274
11352
|
field: {}
|
|
@@ -11358,7 +11436,54 @@ const _sfc_main$6p = /* @__PURE__ */ defineComponent({
|
|
|
11358
11436
|
};
|
|
11359
11437
|
}
|
|
11360
11438
|
});
|
|
11361
|
-
const FieldEditModal = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
11439
|
+
const FieldEditModal = /* @__PURE__ */ _export_sfc(_sfc_main$6q, [["__scopeId", "data-v-1eaa22cd"]]);
|
|
11440
|
+
const _hoisted_1$3z = { class: "xlsx-import-summary" };
|
|
11441
|
+
const _hoisted_2$2w = { class: "xlsx-import-summary__warnings" };
|
|
11442
|
+
const _hoisted_3$1U = { class: "xlsx-import-summary__heading" };
|
|
11443
|
+
const _hoisted_4$1l = { class: "xlsx-import-summary__sheets" };
|
|
11444
|
+
const _sfc_main$6p = /* @__PURE__ */ defineComponent({
|
|
11445
|
+
__name: "xlsx-import-summary",
|
|
11446
|
+
props: {
|
|
11447
|
+
sheets: {},
|
|
11448
|
+
warnings: {}
|
|
11449
|
+
},
|
|
11450
|
+
setup(__props) {
|
|
11451
|
+
return (_ctx, _cache) => {
|
|
11452
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3z, [
|
|
11453
|
+
__props.warnings.length ? (openBlock(), createBlock(unref(Alert), {
|
|
11454
|
+
key: 0,
|
|
11455
|
+
type: "warning",
|
|
11456
|
+
"show-icon": ""
|
|
11457
|
+
}, {
|
|
11458
|
+
message: withCtx(() => [..._cache[0] || (_cache[0] = [
|
|
11459
|
+
createTextVNode("以下内容已做兼容处理,可以继续导入", -1)
|
|
11460
|
+
])]),
|
|
11461
|
+
description: withCtx(() => [
|
|
11462
|
+
createElementVNode("ul", _hoisted_2$2w, [
|
|
11463
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.warnings, (warning2, index2) => {
|
|
11464
|
+
return openBlock(), createElementBlock("li", { key: index2 }, toDisplayString$1(warning2), 1);
|
|
11465
|
+
}), 128))
|
|
11466
|
+
])
|
|
11467
|
+
]),
|
|
11468
|
+
_: 1
|
|
11469
|
+
})) : createCommentVNode("", true),
|
|
11470
|
+
createElementVNode("div", _hoisted_3$1U, "将导入 " + toDisplayString$1(__props.sheets.length) + " 个工作表", 1),
|
|
11471
|
+
createElementVNode("ul", _hoisted_4$1l, [
|
|
11472
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.sheets, (sheet) => {
|
|
11473
|
+
return openBlock(), createElementBlock("li", {
|
|
11474
|
+
key: sheet.title
|
|
11475
|
+
}, [
|
|
11476
|
+
createElementVNode("span", null, toDisplayString$1(sheet.title), 1),
|
|
11477
|
+
createElementVNode("span", null, toDisplayString$1(sheet.rows) + " 行 × " + toDisplayString$1(sheet.cols) + " 列 · " + toDisplayString$1(sheet.fields) + " 个字段绑定", 1)
|
|
11478
|
+
]);
|
|
11479
|
+
}), 128))
|
|
11480
|
+
]),
|
|
11481
|
+
_cache[1] || (_cache[1] = createElementVNode("p", { class: "xlsx-import-summary__replace" }, "导入后将替换当前设计稿,请确认以上处理结果。", -1))
|
|
11482
|
+
]);
|
|
11483
|
+
};
|
|
11484
|
+
}
|
|
11485
|
+
});
|
|
11486
|
+
const XlsxImportSummary = /* @__PURE__ */ _export_sfc(_sfc_main$6p, [["__scopeId", "data-v-e66e3c0e"]]);
|
|
11362
11487
|
let doc$1;
|
|
11363
11488
|
const topPublishVersions = ref([]);
|
|
11364
11489
|
const currentVersion = ref();
|
|
@@ -12350,7 +12475,7 @@ function useSpreadSheet() {
|
|
|
12350
12475
|
}
|
|
12351
12476
|
if (checkSelectionConflict(selection$1)) return;
|
|
12352
12477
|
const { ok, data } = await window.NocodeAdapter.utils.overlay.modal(
|
|
12353
|
-
_sfc_main$
|
|
12478
|
+
_sfc_main$6s,
|
|
12354
12479
|
{ type },
|
|
12355
12480
|
{ title: `添加${$t("sys.onlineForm.subTableType." + type)}`, width: "640px" }
|
|
12356
12481
|
);
|
|
@@ -12422,7 +12547,7 @@ function useSpreadSheet() {
|
|
|
12422
12547
|
return;
|
|
12423
12548
|
}
|
|
12424
12549
|
const { ok, data } = await window.NocodeAdapter.utils.overlay.modal(
|
|
12425
|
-
_sfc_main$
|
|
12550
|
+
_sfc_main$6r,
|
|
12426
12551
|
{},
|
|
12427
12552
|
{
|
|
12428
12553
|
title: $t("sys.onlineForm.addHeader"),
|
|
@@ -12679,22 +12804,24 @@ function useSpreadSheet() {
|
|
|
12679
12804
|
const size = [w - padding.l - padding.r + "mm", paperHeight - padding.t - padding.b + "mm"];
|
|
12680
12805
|
const { modelMetaMap: modelMetaMap2, refreshModelFields: refreshModelFields2 } = useModelFields();
|
|
12681
12806
|
const keyList = (modelMetaMap2.value[doc.value.modelKey]?.fields ?? []).map((i) => i.key);
|
|
12682
|
-
const imported = await XlsxParser.xlsx2Sheets(file, payload?.withFields ? keyList : []
|
|
12807
|
+
const imported = await XlsxParser.xlsx2Sheets(file, payload?.withFields ? keyList : [], {
|
|
12808
|
+
withFields: !!payload?.withFields
|
|
12809
|
+
});
|
|
12683
12810
|
imported.sheets.forEach((sheet) => XlsxParser.contentFitToPaper(sheet.paper, size));
|
|
12684
12811
|
const confirmed = await new Promise((resolve) => {
|
|
12685
12812
|
Modal.confirm({
|
|
12686
12813
|
title: `确认替换为 ${imported.sheets.length} 个工作表`,
|
|
12687
|
-
|
|
12688
|
-
|
|
12689
|
-
imported.sheets.map(
|
|
12690
|
-
|
|
12691
|
-
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
|
|
12695
|
-
|
|
12696
|
-
),
|
|
12697
|
-
okText:
|
|
12814
|
+
width: 680,
|
|
12815
|
+
content: h(XlsxImportSummary, {
|
|
12816
|
+
sheets: imported.sheets.map((sheet) => ({
|
|
12817
|
+
title: sheet.title,
|
|
12818
|
+
rows: sheet.paper.rows.length,
|
|
12819
|
+
cols: sheet.paper.cols.length,
|
|
12820
|
+
fields: sheet.paperFields.length
|
|
12821
|
+
})),
|
|
12822
|
+
warnings: imported.warnings
|
|
12823
|
+
}),
|
|
12824
|
+
okText: imported.warnings.length ? "继续导入" : "导入",
|
|
12698
12825
|
cancelText: $t("sys.cancel"),
|
|
12699
12826
|
zIndex: 2e3,
|
|
12700
12827
|
onOk: () => resolve(true),
|
|
@@ -12713,20 +12840,6 @@ function useSpreadSheet() {
|
|
|
12713
12840
|
}
|
|
12714
12841
|
return result;
|
|
12715
12842
|
};
|
|
12716
|
-
const importedFieldOwners = /* @__PURE__ */ new Map();
|
|
12717
|
-
imported.sheets.forEach((sheet) => {
|
|
12718
|
-
sheet.paperFields.forEach((field) => {
|
|
12719
|
-
const key = field.fieldKey || field.fieldName;
|
|
12720
|
-
if (!key) return;
|
|
12721
|
-
const owner = importedFieldOwners.get(key);
|
|
12722
|
-
if (owner) {
|
|
12723
|
-
throw new Error(
|
|
12724
|
-
`字段「${key}」重复出现(${owner}、${sheet.title}),同一字段只能导入一次`
|
|
12725
|
-
);
|
|
12726
|
-
}
|
|
12727
|
-
importedFieldOwners.set(key, sheet.title);
|
|
12728
|
-
});
|
|
12729
|
-
});
|
|
12730
12843
|
imported.fields?.forEach((item) => {
|
|
12731
12844
|
const { type, key, name: rawName, required, uniqueConstraint, disabled } = item;
|
|
12732
12845
|
if (!key || !rawName) {
|
|
@@ -13114,6 +13227,7 @@ function useSpreadSheet() {
|
|
|
13114
13227
|
}
|
|
13115
13228
|
}
|
|
13116
13229
|
const fieldWidget = getFieldWidget2(bindField);
|
|
13230
|
+
sheetsData.value.forEach((sheet) => clearHiddenCellFieldPlacements(sheet.paper, bindField));
|
|
13117
13231
|
const content = {
|
|
13118
13232
|
type: CellType.Field,
|
|
13119
13233
|
fieldMeta: bindField,
|
|
@@ -15930,7 +16044,7 @@ function asyncImportWidgetConfigList() {
|
|
|
15930
16044
|
return widgetConfigList;
|
|
15931
16045
|
}
|
|
15932
16046
|
function asyncImportWidgetDesign() {
|
|
15933
|
-
const modules = /* @__PURE__ */ Object.assign({ "../__cell_widgets__/cell-widget-design.vue": () => Promise.resolve().then(() => cellWidgetDesign), "../__cell_widgets__/seal/seal-design.vue": () => import("./seal-design-
|
|
16047
|
+
const modules = /* @__PURE__ */ Object.assign({ "../__cell_widgets__/cell-widget-design.vue": () => Promise.resolve().then(() => cellWidgetDesign), "../__cell_widgets__/seal/seal-design.vue": () => import("./seal-design-C5P3oQIa.js"), "./barcode/barcode-design.vue": () => import("./barcode-design-CH7C0nTV.js"), "./diagonal/diagonal-design.vue": () => import("./diagonal-design-CKLfmzt9.js"), "./image/image-design.vue": () => import("./image-design-AOi1nT_M.js"), "./line/line-design.vue": () => Promise.resolve().then(() => lineDesign), "./pagination/pagination-design.vue": () => import("./pagination-design-BjxLbj93.js"), "./paper-widget-design.vue": () => import("./paper-widget-design-Cy2MxlCk.js"), "./power/power-design.vue": () => Promise.resolve().then(() => powerDesign), "./qrcode/qrcode-design.vue": () => import("./qrcode-design-DM9kEawx.js"), "./rangelimit/rangelimit-design.vue": () => Promise.resolve().then(() => rangelimitDesign), "./serialnumber/serialnumber-design.vue": () => import("./serialnumber-design-QaDIsxYT.js"), "./text/text-design.vue": () => import("./text-design-DfdH_3_b.js"), "./timediff/timediff-design.vue": () => import("./timediff-design-CKjl56qS.js") });
|
|
15934
16048
|
const widgetDesignMap = Object.keys(modules).reduce((map2, path) => {
|
|
15935
16049
|
const mKey = path.match(/\/([a-z]+)-design\.vue$/)?.[1];
|
|
15936
16050
|
if (mKey) {
|
|
@@ -52895,7 +53009,7 @@ const _sfc_main$3q = /* @__PURE__ */ defineComponent({
|
|
|
52895
53009
|
}
|
|
52896
53010
|
});
|
|
52897
53011
|
function asyncImportWidgetProp() {
|
|
52898
|
-
const modules = /* @__PURE__ */ Object.assign({ "./widget-barcode.vue": () => import("./widget-barcode-
|
|
53012
|
+
const modules = /* @__PURE__ */ Object.assign({ "./widget-barcode.vue": () => import("./widget-barcode-By9P2d-R.js"), "./widget-diagonal.vue": () => import("./widget-diagonal-DMNfA-Tt.js"), "./widget-image.vue": () => import("./widget-image-YM9YaMb-.js"), "./widget-line.vue": () => import("./widget-line-Dl3TIfBO.js"), "./widget-pagination.vue": () => import("./widget-pagination-9XxvQDIw.js"), "./widget-power.vue": () => import("./widget-power-A96VVJDG.js"), "./widget-qrcode.vue": () => import("./widget-qrcode-DWseHVIM.js"), "./widget-rangelimit.vue": () => import("./widget-rangelimit-DK8oOmC_.js"), "./widget-serialnumber.vue": () => import("./widget-serialnumber-pue8WfA9.js"), "./widget-text.vue": () => import("./widget-text-B9O9UYK7.js"), "./widget-timediff.vue": () => import("./widget-timediff-PwNxXBrF.js") });
|
|
52899
53013
|
const widgetPropMap = Object.keys(modules).reduce((map2, path) => {
|
|
52900
53014
|
const mKey = path.match(/\/widget-([a-z]+)\.vue$/)?.[1];
|
|
52901
53015
|
if (mKey) {
|
|
@@ -62328,7 +62442,7 @@ const _sfc_main$2v = /* @__PURE__ */ defineComponent({
|
|
|
62328
62442
|
onSelect: onClearAll
|
|
62329
62443
|
}, null, 8, ["value"]),
|
|
62330
62444
|
_cache[9] || (_cache[9] = createElementVNode("div", { class: "split" }, null, -1)),
|
|
62331
|
-
joinModelType.value === unref(JoinModelTypeEum).FormModel ? (openBlock(), createBlock(unref(_sfc_main$
|
|
62445
|
+
joinModelType.value === unref(JoinModelTypeEum).FormModel ? (openBlock(), createBlock(unref(_sfc_main$6u), {
|
|
62332
62446
|
key: 0,
|
|
62333
62447
|
class: "custom-select",
|
|
62334
62448
|
placeholder: _ctx.$t("sys.cardDesign.form.modelRequired"),
|
|
@@ -73881,12 +73995,8 @@ const _sfc_main$1C = /* @__PURE__ */ defineComponent({
|
|
|
73881
73995
|
...props2.widget,
|
|
73882
73996
|
props: {
|
|
73883
73997
|
...props2.widget.props,
|
|
73884
|
-
displayFields: [
|
|
73885
|
-
{ key: "code_", name: $t("sys.edhr.field.code") }
|
|
73886
|
-
{ key: "product_id_name_", name: "产品名称" },
|
|
73887
|
-
{ key: "product_id_code_", name: "产品编码" },
|
|
73888
|
-
{ key: "product_id_spec_", name: "产品规格" },
|
|
73889
|
-
{ key: "qty_", name: "数量" }
|
|
73998
|
+
displayFields: props2.widget.props.displayFields ?? [
|
|
73999
|
+
{ key: "code_", name: $t("sys.edhr.field.code") }
|
|
73890
74000
|
],
|
|
73891
74001
|
quickSearchable: true,
|
|
73892
74002
|
quickSearchField,
|
|
@@ -74139,7 +74249,7 @@ const _sfc_main$1C = /* @__PURE__ */ defineComponent({
|
|
|
74139
74249
|
};
|
|
74140
74250
|
}
|
|
74141
74251
|
});
|
|
74142
|
-
const selectRender = /* @__PURE__ */ _export_sfc(_sfc_main$1C, [["__scopeId", "data-v-
|
|
74252
|
+
const selectRender = /* @__PURE__ */ _export_sfc(_sfc_main$1C, [["__scopeId", "data-v-b2337210"]]);
|
|
74143
74253
|
const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
74144
74254
|
__proto__: null,
|
|
74145
74255
|
default: selectRender
|
|
@@ -80495,6 +80605,8 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
|
|
|
80495
80605
|
default: withCtx(() => [
|
|
80496
80606
|
createVNode(unref(CellMedia), {
|
|
80497
80607
|
class: normalizeClass([
|
|
80608
|
+
"image-cell-content",
|
|
80609
|
+
images.value.length && isAdaptive.value && "is-adaptive",
|
|
80498
80610
|
!images.value.length && unref(showRequired) && "is-show-required",
|
|
80499
80611
|
unref(realFieldId),
|
|
80500
80612
|
unref(showDisplayStatus),
|
|
@@ -80555,7 +80667,7 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
|
|
|
80555
80667
|
};
|
|
80556
80668
|
}
|
|
80557
80669
|
});
|
|
80558
|
-
const uploadImageRender = /* @__PURE__ */ _export_sfc(_sfc_main$1r, [["__scopeId", "data-v-
|
|
80670
|
+
const uploadImageRender = /* @__PURE__ */ _export_sfc(_sfc_main$1r, [["__scopeId", "data-v-7e75d4f0"]]);
|
|
80559
80671
|
const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
80560
80672
|
__proto__: null,
|
|
80561
80673
|
default: uploadImageRender
|
|
@@ -88566,7 +88678,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
88566
88678
|
help: getSubstituteProductError(record) || void 0
|
|
88567
88679
|
}, {
|
|
88568
88680
|
default: withCtx(() => [
|
|
88569
|
-
createVNode(_sfc_main$
|
|
88681
|
+
createVNode(_sfc_main$6v, {
|
|
88570
88682
|
"model-value": record.product_id_ || void 0,
|
|
88571
88683
|
"model-key": "em_product",
|
|
88572
88684
|
placeholder: _ctx.$t("sys.chooseText"),
|
|
@@ -88941,7 +89053,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
88941
89053
|
help: getMainProductError() || void 0
|
|
88942
89054
|
}, {
|
|
88943
89055
|
default: withCtx(() => [
|
|
88944
|
-
createVNode(_sfc_main$
|
|
89056
|
+
createVNode(_sfc_main$6v, {
|
|
88945
89057
|
"model-value": unref(formState).product_id_ || void 0,
|
|
88946
89058
|
"model-key": "em_product",
|
|
88947
89059
|
placeholder: _ctx.$t("sys.chooseText"),
|
|
@@ -91133,8 +91245,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
91133
91245
|
printTask = (async () => {
|
|
91134
91246
|
if (document.activeElement instanceof HTMLElement) document.activeElement.blur();
|
|
91135
91247
|
await nextTick();
|
|
91136
|
-
const { printRuntimeInstance } = await import("./print-runtime-instance-
|
|
91137
|
-
const { default: renderer } = await import("./print-snapshot-renderer-
|
|
91248
|
+
const { printRuntimeInstance } = await import("./print-runtime-instance-THb92xUW.js");
|
|
91249
|
+
const { default: renderer } = await import("./print-snapshot-renderer-4jQFaAjJ.js");
|
|
91138
91250
|
if (abort.signal.aborted) throw new Error("打印已取消");
|
|
91139
91251
|
printRenderer.value = markRaw(renderer);
|
|
91140
91252
|
await printRuntimeInstance(
|
|
@@ -91281,7 +91393,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
91281
91393
|
provide(NCB_PROVIDE.RUNTIME_INSTANCE_REGISTRY, runtimeRegistry);
|
|
91282
91394
|
initWebPaasUploadApis();
|
|
91283
91395
|
return (_ctx, _cache) => {
|
|
91284
|
-
return openBlock(), createBlock(unref(_sfc_main$
|
|
91396
|
+
return openBlock(), createBlock(unref(_sfc_main$6w), {
|
|
91285
91397
|
loading: __props.loading,
|
|
91286
91398
|
"has-data": __props.hasData,
|
|
91287
91399
|
error: unref(runtimeRegistry).loadState.error?.message
|