mixdashboards 1.1.166 → 1.1.167
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/{AlarmConditionField-P4RVtTIL.js → AlarmConditionField-DfaepmtO.js} +2 -2
- package/dist/{DashboardDetail-fE0VbjVP.js → DashboardDetail-1QP5RnrR.js} +1 -1
- package/dist/{DashboardEditor-Drlo0bP9.js → DashboardEditor-Duv7gSFo.js} +4 -4
- package/dist/{DashboardPreview-BhvsslTZ.js → DashboardPreview-Bnx2Ho04.js} +3 -3
- package/dist/DesignApp-C0QXixOo.js +4 -0
- package/dist/DesignPro-ByaWEqW-.js +4 -0
- package/dist/DesignShow-DQxN6Map.js +4 -0
- package/dist/{dashboardShareImport-BYmjD21Z.js → dashboardShareImport-CqNDBobw.js} +1 -1
- package/dist/{index-D6iJVzGe.js → index-_JhYcBS5.js} +177644 -178406
- package/dist/{lerc-CqxMCvPG.js → lerc-DGYEeuHr.js} +1 -1
- package/dist/mixdashboards.css +1 -1
- package/dist/mixdashboards.js +1 -1
- package/dist/{previewShell-Cg5HGJOv.js → previewShell-CXMc8U0d.js} +1 -1
- package/dist/{vue3-form-element.esm.min-C0XZKEKW.js → vue3-form-element.esm.min-C4i0tGf1.js} +15 -15
- package/package.json +1 -1
- package/dist/DesignApp-DYbyqH0t.js +0 -4
- package/dist/DesignPro-lVQrb9Pr.js +0 -4
- package/dist/DesignShow-BfjdGpsf.js +0 -4
- package/dist/equipmentManagement.import-D4sriuvt.js +0 -321
package/dist/mixdashboards.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as t } from "./index-
|
|
1
|
+
import { m as t } from "./index-_JhYcBS5.js";
|
|
2
2
|
function s(e) {
|
|
3
3
|
var r, o;
|
|
4
4
|
return String((r = e.dashboard_type) != null ? r : "").toLowerCase() !== "pro" ? !1 : String((o = e.device_type) != null ? o : "").toLowerCase() === "mobile" ? !0 : t(e.script);
|
package/dist/{vue3-form-element.esm.min-C0XZKEKW.js → vue3-form-element.esm.min-C4i0tGf1.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getCurrentInstance as ua, toRef as Ha, provide as Ka, ref as Je, computed as ke, watch as Ze, h as $, resolveComponent as Xe, toRaw as xt, inject as Ga, openBlock as fe, createBlock as pe, createVNode as rr, toDisplayString as ut, createCommentVNode as Ot, renderSlot as Za, withCtx as pr, Fragment as ct, renderList as mt, createTextVNode as ca, defineComponent as Ja, onMounted as Xa } from "vue";
|
|
2
2
|
function or(e) {
|
|
3
3
|
return (or = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(a) {
|
|
4
4
|
return typeof a;
|
|
@@ -141,7 +141,7 @@ function Ir(e, a, o) {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
function ve(e) {
|
|
144
|
-
return typeof e == "string" ?
|
|
144
|
+
return typeof e == "string" ? Xe(e) : e;
|
|
145
145
|
}
|
|
146
146
|
function Q(e) {
|
|
147
147
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
@@ -2568,7 +2568,7 @@ var Oe = { formProps: { type: null }, globalOptions: { type: null }, schema: { t
|
|
|
2568
2568
|
} }, uiProps: { type: Object, default: function() {
|
|
2569
2569
|
return {};
|
|
2570
2570
|
} }, formProps: null, getWidget: null, renderScopedSlots: null, globalOptions: null, onChange: null }, emits: ["otherDataChange"], inheritAttrs: !0, setup: function(e, a) {
|
|
2571
|
-
var o = a.emit, r =
|
|
2571
|
+
var o = a.emit, r = Ga("genFormProvide"), t = ke({ get: function() {
|
|
2572
2572
|
return e.isFormData ? Te(e.rootFormData, e.curNodePath) : e.curValue;
|
|
2573
2573
|
}, set: function(s) {
|
|
2574
2574
|
var l = s === "" || s === null ? e.emptyValue : s;
|
|
@@ -2578,7 +2578,7 @@ var Oe = { formProps: { type: null }, globalOptions: { type: null }, schema: { t
|
|
|
2578
2578
|
return (s = e.uiRequired) !== null && s !== void 0 ? s : e.required;
|
|
2579
2579
|
}));
|
|
2580
2580
|
e.uiProps.enumOptions && e.uiProps.enumOptions.length > 0 && t.value === void 0 && t.value !== e.uiProps.enumOptions[0] && (e.schema.items ? t.value = [] : n.value && e.formProps.defaultSelectFirstOption && (t.value = e.uiProps.enumOptions[0].value));
|
|
2581
|
-
var i =
|
|
2581
|
+
var i = Je(null);
|
|
2582
2582
|
return typeof e.getWidget == "function" && Ze(i, (function() {
|
|
2583
2583
|
e.getWidget.call(null, i.value);
|
|
2584
2584
|
})), function() {
|
|
@@ -2739,7 +2739,7 @@ var Oe = { formProps: { type: null }, globalOptions: { type: null }, schema: { t
|
|
|
2739
2739
|
var a = this, o = function() {
|
|
2740
2740
|
var l = Te(e.rootFormData, e.curNodePath);
|
|
2741
2741
|
return Array.isArray(l) ? l : [];
|
|
2742
|
-
}, r =
|
|
2742
|
+
}, r = Je(o().map((function() {
|
|
2743
2743
|
return dr();
|
|
2744
2744
|
}))), t = ke((function() {
|
|
2745
2745
|
return o();
|
|
@@ -2802,7 +2802,7 @@ var Oe = { formProps: { type: null }, globalOptions: { type: null }, schema: { t
|
|
|
2802
2802
|
}), {}), uiSchema: c, errorSchema: e.errorSchema, curNodePath: d, rootFormData: p, globalOptions: m }) : null]);
|
|
2803
2803
|
};
|
|
2804
2804
|
} }, na = { name: "SelectLinkageField", props: F(F({}, Oe), {}, { combiningType: { type: String, default: "anyOf" }, selectList: { type: Array, require: !0 } }), setup: function(e) {
|
|
2805
|
-
var a =
|
|
2805
|
+
var a = Je(qr(Te(e.rootFormData, e.curNodePath), e.selectList, e.rootSchema, !0) || 0), o = function() {
|
|
2806
2806
|
var r = yr({ schema: e.schema["".concat(e.combiningType, "Select")] || {}, uiSchema: e.uiSchema["".concat(e.combiningType, "Select")] || {}, curNodePath: e.curNodePath, rootFormData: e.rootFormData }, (function() {
|
|
2807
2807
|
return { widget: "SelectWidget" };
|
|
2808
2808
|
}));
|
|
@@ -2875,7 +2875,7 @@ var Oe = { formProps: { type: null }, globalOptions: { type: null }, schema: { t
|
|
|
2875
2875
|
return [];
|
|
2876
2876
|
}, type: [Array] } } };
|
|
2877
2877
|
it.render = function(e, a, o, r, t, n) {
|
|
2878
|
-
var i =
|
|
2878
|
+
var i = Xe("el-checkbox"), s = Xe("el-checkbox-group");
|
|
2879
2879
|
return fe(), pe(s, e.$attrs, { default: pr((function() {
|
|
2880
2880
|
return [(fe(!0), pe(ct, null, mt(o.enumOptions, (function(l, c) {
|
|
2881
2881
|
return fe(), pe(i, { key: c, label: l.value }, { default: pr((function() {
|
|
@@ -2888,7 +2888,7 @@ var st = { name: "RadioWidget", props: { enumOptions: { default: function() {
|
|
|
2888
2888
|
return [];
|
|
2889
2889
|
}, type: [Array] } } };
|
|
2890
2890
|
st.render = function(e, a, o, r, t, n) {
|
|
2891
|
-
var i =
|
|
2891
|
+
var i = Xe("el-radio"), s = Xe("el-radio-group");
|
|
2892
2892
|
return fe(), pe(s, e.$attrs, { default: pr((function() {
|
|
2893
2893
|
return [(fe(!0), pe(ct, null, mt(o.enumOptions, (function(l, c) {
|
|
2894
2894
|
return fe(), pe(i, { key: c, label: l.value }, { default: pr((function() {
|
|
@@ -2906,7 +2906,7 @@ function ia(e) {
|
|
|
2906
2906
|
}));
|
|
2907
2907
|
}
|
|
2908
2908
|
lt.render = function(e, a, o, r, t, n) {
|
|
2909
|
-
var i =
|
|
2909
|
+
var i = Xe("el-option"), s = Xe("el-select");
|
|
2910
2910
|
return fe(), pe(s, e.$attrs, { default: pr((function() {
|
|
2911
2911
|
return [(fe(!0), pe(ct, null, mt(o.enumOptions, (function(l, c) {
|
|
2912
2912
|
return fe(), pe(i, { key: c, label: l.label, value: l.value }, null, 8, ["label", "value"]);
|
|
@@ -2923,7 +2923,7 @@ var sa = function(e) {
|
|
|
2923
2923
|
return n.setHours(+o), n.setMinutes(+r), n.setSeconds(+t), n;
|
|
2924
2924
|
}
|
|
2925
2925
|
}, Ke = { CheckboxesWidget: it, RadioWidget: st, SelectWidget: lt, TimePickerWidget: { name: "TimePickerWidget", inheritAttrs: !1, props: { modelValue: { default: null, type: null } }, setup: function(e, a) {
|
|
2926
|
-
var o = a.attrs, r = a.slots, t =
|
|
2926
|
+
var o = a.attrs, r = a.slots, t = Je(la(e.modelValue)), n = e.modelValue;
|
|
2927
2927
|
return Ze((function() {
|
|
2928
2928
|
return e.modelValue;
|
|
2929
2929
|
}), (function(i) {
|
|
@@ -2965,7 +2965,7 @@ var sa = function(e) {
|
|
|
2965
2965
|
}, type: [Function] }, btnText: { type: String, default: "点击上传" }, slots: { type: null, default: null } }, setup: function(e, a) {
|
|
2966
2966
|
var o = a.attrs, r = a.emit, t = e.modelValue, n = Array.isArray(t), i = o.fileList || (n ? t.map((function(p, d) {
|
|
2967
2967
|
return { name: "已上传文件(".concat(d + 1, ")"), url: p };
|
|
2968
|
-
})) : t ? [{ name: "已上传文件", url: t }] : []), s =
|
|
2968
|
+
})) : t ? [{ name: "已上传文件", url: t }] : []), s = Je(i), l = function(p) {
|
|
2969
2969
|
return p && (p.response && e.responseFileUrl(p.response) || p.url) || "";
|
|
2970
2970
|
}, c = function(p) {
|
|
2971
2971
|
var d;
|
|
@@ -3006,7 +3006,7 @@ var sa = function(e) {
|
|
|
3006
3006
|
} } }, $n = { types: { boolean: "el-switch", string: "el-input", number: "el-input-number", integer: "el-input-number" }, formats: { color: "el-color-picker", time: Ke.TimePickerWidget, date: Ke.DatePickerWidget, "date-time": Ke.DateTimePickerWidget }, common: { select: Ke.SelectWidget, radioGroup: Ke.RadioWidget, checkboxGroup: Ke.CheckboxesWidget }, widgetComponents: Ke };
|
|
3007
3007
|
Ua(".genFromComponent.el-form--label-top .el-form-item__label{line-height:26px}.genFromComponent.el-form--label-top .genFromWidget_des{margin-bottom:4px;margin-top:-4px}.genFromComponent .el-checkbox,.genFromComponent .el-color-picker{vertical-align:top}.genFromComponent .formFooter_item .el-form-item__content{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}");
|
|
3008
3008
|
var Rn = { WIDGET_MAP: $n, COMPONENT_MAP: { form: Ja({ inheritAttrs: !1, setup: function(e, a) {
|
|
3009
|
-
var o = a.attrs, r = a.slots, t =
|
|
3009
|
+
var o = a.attrs, r = a.slots, t = Je(null);
|
|
3010
3010
|
return o.setFormRef && Xa((function() {
|
|
3011
3011
|
o.setFormRef(t.value);
|
|
3012
3012
|
})), function() {
|
|
@@ -3023,9 +3023,9 @@ var Rn = { WIDGET_MAP: $n, COMPONENT_MAP: { form: Ja({ inheritAttrs: !1, setup:
|
|
|
3023
3023
|
var g = Le(m, 2), h = g[0], b = g[1];
|
|
3024
3024
|
return i.appContext.app.component(h, b);
|
|
3025
3025
|
})), a.installed = !0);
|
|
3026
|
-
var s =
|
|
3027
|
-
|
|
3028
|
-
var l =
|
|
3026
|
+
var s = Ha(o, "fallbackLabel");
|
|
3027
|
+
Ka("genFormProvide", { fallbackLabel: s });
|
|
3028
|
+
var l = Je(vr(o.schema, o.modelValue, o.schema, o.strictMode)), c = ke((function() {
|
|
3029
3029
|
return F({ show: !0, okBtn: "保存", okBtnProps: {}, cancelBtn: "取消" }, o.formFooter);
|
|
3030
3030
|
})), u = null, p = function(m, g) {
|
|
3031
3031
|
n("update:modelValue", m), n("change", { newValue: m, oldValue: g });
|
package/package.json
CHANGED
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
import { ElMessage as q } from "element-plus";
|
|
2
|
-
import { read as O, utils as u, SSF as P } from "./xlsx-CwHzt_65.js";
|
|
3
|
-
function x(n) {
|
|
4
|
-
if (!n)
|
|
5
|
-
throw new Error("缺少上传文件");
|
|
6
|
-
return n;
|
|
7
|
-
}
|
|
8
|
-
function re(n, e) {
|
|
9
|
-
return new Promise((c, r) => {
|
|
10
|
-
const a = () => {
|
|
11
|
-
q.error("无效的导入模式"), r(new Error("无效的导入模式"));
|
|
12
|
-
}, t = new FileReader();
|
|
13
|
-
t.onload = (o) => {
|
|
14
|
-
var i;
|
|
15
|
-
try {
|
|
16
|
-
const l = (i = o.target) == null ? void 0 : i.result;
|
|
17
|
-
if (!(l instanceof ArrayBuffer))
|
|
18
|
-
throw new Error("无法读取文件内容");
|
|
19
|
-
const s = new Uint8Array(l), d = O(s, { type: "array" });
|
|
20
|
-
switch (e) {
|
|
21
|
-
case "device":
|
|
22
|
-
c(V(d));
|
|
23
|
-
break;
|
|
24
|
-
case "timer":
|
|
25
|
-
c(A(d));
|
|
26
|
-
break;
|
|
27
|
-
case "inspect":
|
|
28
|
-
c(Z(d));
|
|
29
|
-
break;
|
|
30
|
-
default:
|
|
31
|
-
a();
|
|
32
|
-
}
|
|
33
|
-
} catch (l) {
|
|
34
|
-
console.error(l), q.error("解析Excel文件时出错"), r(new Error("解析Excel文件时出错"));
|
|
35
|
-
}
|
|
36
|
-
}, t.onerror = (o) => {
|
|
37
|
-
console.error(o), q.error("解析Excel文件时出错"), r(new Error("读取文件失败"));
|
|
38
|
-
}, t.readAsArrayBuffer(x(n));
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
function A(n) {
|
|
42
|
-
const e = [];
|
|
43
|
-
return Object.keys(n.Sheets).forEach((c) => {
|
|
44
|
-
var C, m;
|
|
45
|
-
const r = n.Sheets[c], a = r["!ref"];
|
|
46
|
-
if (!a) return;
|
|
47
|
-
const t = u.decode_range(a), o = 2, i = { std: 0, name: 1, priority: 2, operation: 3, cycle: 4, stats: 5, pNum: 6, pUnit: 7, nNum: 8, nUnit: 9 };
|
|
48
|
-
let l = "";
|
|
49
|
-
l || (l = c.trim() || "IMPORT");
|
|
50
|
-
let s = "", d = "", g = "";
|
|
51
|
-
const S = {};
|
|
52
|
-
for (let p = o; p <= t.e.r; p++) {
|
|
53
|
-
const E = r[u.encode_cell({ r: p, c: i.std })];
|
|
54
|
-
if (E && E.v && (l = String(E.v)), !l) continue;
|
|
55
|
-
const f = r[u.encode_cell({ r: p, c: i.name })], F = r[u.encode_cell({ r: p, c: i.priority })], b = r[u.encode_cell({ r: p, c: i.operation })], I = r[u.encode_cell({ r: p, c: i.cycle })], y = r[u.encode_cell({ r: p, c: i.stats })], h = r[u.encode_cell({ r: p, c: i.pNum })], v = r[u.encode_cell({ r: p, c: i.pUnit })], w = r[u.encode_cell({ r: p, c: i.nNum })], N = r[u.encode_cell({ r: p, c: i.nUnit })];
|
|
56
|
-
if ((f == null ? void 0 : f.v) != null && String(f.v) !== "" && (s = f.v, d = (C = F == null ? void 0 : F.v) != null ? C : "", g = (m = b == null ? void 0 : b.v) != null ? m : ""), !I || !I.v) continue;
|
|
57
|
-
const _ = !!h && h.v !== "" && !!v && v.v !== "", G = !!w && w.v !== "" && !!N && N.v !== "";
|
|
58
|
-
if (!_ && !G) continue;
|
|
59
|
-
const R = (f == null ? void 0 : f.v) != null && String(f.v) !== "" ? f.v : s;
|
|
60
|
-
if (R === "" || R == null) continue;
|
|
61
|
-
const M = {
|
|
62
|
-
name: R,
|
|
63
|
-
priority: d || null,
|
|
64
|
-
operation: g || "",
|
|
65
|
-
cycle_type: I.v,
|
|
66
|
-
statistics_id: y && y.v ? y.v : null,
|
|
67
|
-
period_num: h && h.v !== "" ? typeof h.v == "number" ? h.v : parseFloat(String(h.v)) : null,
|
|
68
|
-
period_unit: v && v.v !== "" ? v.v : null,
|
|
69
|
-
notice_num: w && w.v !== "" ? typeof w.v == "number" ? w.v : parseFloat(String(w.v)) : null,
|
|
70
|
-
notice_unit: N && N.v !== "" ? N.v : null
|
|
71
|
-
}, U = String(R);
|
|
72
|
-
S[U] || (S[U] = []), S[U].push(M);
|
|
73
|
-
}
|
|
74
|
-
Object.keys(S).length > 0 && e.push({
|
|
75
|
-
name: c,
|
|
76
|
-
serial_num: l,
|
|
77
|
-
data: S
|
|
78
|
-
});
|
|
79
|
-
}), e;
|
|
80
|
-
}
|
|
81
|
-
const j = {
|
|
82
|
-
设备编号: "serial_num",
|
|
83
|
-
设备名称: "name",
|
|
84
|
-
工厂编号: "factory_serial_num",
|
|
85
|
-
工厂名称: "factory_name",
|
|
86
|
-
制造商: "manufacturer_name",
|
|
87
|
-
设备类型编号: "equipment_type_serial_num",
|
|
88
|
-
设备类型: "equipment_type_name",
|
|
89
|
-
设备型号: "model",
|
|
90
|
-
所在车间: "workshop_name",
|
|
91
|
-
进厂时间: "enter_factory_time",
|
|
92
|
-
在用状态: "is_available",
|
|
93
|
-
关联对象: "object_id",
|
|
94
|
-
维保优先级: "timer_priority_name",
|
|
95
|
-
资产编码: "asset_code",
|
|
96
|
-
设备操作员: "equipment_operator",
|
|
97
|
-
维修责任人: "repairman",
|
|
98
|
-
供应商业务员: "supplier_salesman",
|
|
99
|
-
供应商电话: "supplier_phone"
|
|
100
|
-
}, $ = [
|
|
101
|
-
"serial_num",
|
|
102
|
-
"name",
|
|
103
|
-
"factory_serial_num",
|
|
104
|
-
"factory_name",
|
|
105
|
-
"manufacturer_name",
|
|
106
|
-
"equipment_type_serial_num",
|
|
107
|
-
"equipment_type_name",
|
|
108
|
-
"model",
|
|
109
|
-
"workshop_name",
|
|
110
|
-
"enter_factory_time",
|
|
111
|
-
"is_available",
|
|
112
|
-
"object_id",
|
|
113
|
-
"timer_priority_name",
|
|
114
|
-
"asset_code",
|
|
115
|
-
"equipment_operator",
|
|
116
|
-
"repairman",
|
|
117
|
-
"supplier_salesman",
|
|
118
|
-
"supplier_phone"
|
|
119
|
-
];
|
|
120
|
-
function k(n) {
|
|
121
|
-
return String(n).padStart(2, "0");
|
|
122
|
-
}
|
|
123
|
-
function D(n, e, c, r, a, t) {
|
|
124
|
-
return `${n}-${k(e)}-${k(c)} ${k(r)}:${k(a)}:${k(t)}`;
|
|
125
|
-
}
|
|
126
|
-
function L(n) {
|
|
127
|
-
var r, a, t;
|
|
128
|
-
if (n.v == null || n.v === "") return "";
|
|
129
|
-
if (n.t === "n" && typeof n.v == "number") {
|
|
130
|
-
const o = P.parse_date_code(n.v);
|
|
131
|
-
return D(o.y, o.m, o.d, o.H, o.M, o.S);
|
|
132
|
-
}
|
|
133
|
-
const e = String(n.v).trim(), c = e.match(/^(\d{4})[/-](\d{1,2})[/-](\d{1,2})(?:\s+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?)?/);
|
|
134
|
-
return c ? D(
|
|
135
|
-
Number(c[1]),
|
|
136
|
-
Number(c[2]),
|
|
137
|
-
Number(c[3]),
|
|
138
|
-
Number((r = c[4]) != null ? r : 0),
|
|
139
|
-
Number((a = c[5]) != null ? a : 0),
|
|
140
|
-
Number((t = c[6]) != null ? t : 0)
|
|
141
|
-
) : e;
|
|
142
|
-
}
|
|
143
|
-
function H() {
|
|
144
|
-
return Object.fromEntries($.map((n) => [n, ""]));
|
|
145
|
-
}
|
|
146
|
-
function B(n, e) {
|
|
147
|
-
return !n || n.v == null || n.v === "" ? "" : e === "enter_factory_time" ? L(n) : String(n.v).trim();
|
|
148
|
-
}
|
|
149
|
-
function V(n) {
|
|
150
|
-
var i;
|
|
151
|
-
const e = [], c = n.SheetNames[0];
|
|
152
|
-
if (!c) return e;
|
|
153
|
-
const r = n.Sheets[c], a = r["!ref"];
|
|
154
|
-
if (!a) return e;
|
|
155
|
-
const t = u.decode_range(a), o = [];
|
|
156
|
-
for (let l = 0; l <= t.e.c; l++) {
|
|
157
|
-
const s = r[u.encode_cell({ r: 0, c: l })];
|
|
158
|
-
if (!(s != null && s.v)) continue;
|
|
159
|
-
const d = j[String(s.v).trim()];
|
|
160
|
-
d && o.push({ col: l, field: d });
|
|
161
|
-
}
|
|
162
|
-
for (let l = 1; l <= t.e.r; l++) {
|
|
163
|
-
const s = H();
|
|
164
|
-
for (const { col: d, field: g } of o) {
|
|
165
|
-
const S = r[u.encode_cell({ r: l, c: d })];
|
|
166
|
-
s[g] = B(S, g);
|
|
167
|
-
}
|
|
168
|
-
(i = s.serial_num) != null && i.trim() && e.push(s);
|
|
169
|
-
}
|
|
170
|
-
return e;
|
|
171
|
-
}
|
|
172
|
-
function z(n) {
|
|
173
|
-
const e = n[u.encode_cell({ r: 0, c: 0 })], c = n[u.encode_cell({ r: 1, c: 0 })], r = (e == null ? void 0 : e.v) != null ? String(e.v).trim() : "", a = (c == null ? void 0 : c.v) != null ? String(c.v).trim() : "", t = (o) => o.includes("标准") && (o.includes("编号") || o.includes("类型")) || o.includes("设备类型编号") || o === "项目编号";
|
|
174
|
-
return t(a) && !t(r) ? 2 : (t(r), 1);
|
|
175
|
-
}
|
|
176
|
-
function K(n) {
|
|
177
|
-
return n != null ? String(n).replace(/\s+/g, "").trim() : "";
|
|
178
|
-
}
|
|
179
|
-
function W(n) {
|
|
180
|
-
const e = K(n);
|
|
181
|
-
return e ? e.includes("文本") || e.includes("数字") ? "文本" : e.includes("布尔") ? "布尔" : e.includes("单选") ? "单选" : e.includes("多选") ? "多选" : null : null;
|
|
182
|
-
}
|
|
183
|
-
function Y(n, e, c) {
|
|
184
|
-
const r = n[u.encode_cell({ r: e, c })];
|
|
185
|
-
return (r == null ? void 0 : r.v) != null ? String(r.v).replace(/\s+/g, "").trim() : "";
|
|
186
|
-
}
|
|
187
|
-
function J(n) {
|
|
188
|
-
const e = n.replace(/\s+/g, "").trim();
|
|
189
|
-
return e ? e.includes("标准编号") ? "std" : e.includes("巡检任务名称") ? "name" : e.includes("设备类型编号") || e.includes("标准") && (e.includes("编号") || e.includes("类型")) || e === "项目编号" ? "std" : e.includes("巡检操作指导") || e.includes("操作指导") ? "ruleGuide" : e.includes("周期单位") || e === "单位" ? "periodUnit" : e.includes("巡检频次") || e.includes("频次") || e.includes("频率") && !e.includes("周期") ? "periodFreq" : e.includes("周期数值") || e.includes("周期间隔") || e.includes("间隔数值") || e.includes("周期") && (e.includes("数") || e.includes("值")) || e === "数值" ? "periodNum" : e.includes("任务名称") || e.includes("规则名称") ? "name" : e.includes("录入类型") || e.includes("选项类型") || e === "类型" || e.endsWith("类型") ? "type" : null : null;
|
|
190
|
-
}
|
|
191
|
-
function Q(n, e) {
|
|
192
|
-
const c = Math.min(4, e.e.r), r = ["name", "ruleGuide", "periodNum", "periodUnit", "periodFreq", "type"];
|
|
193
|
-
function a(t, o) {
|
|
194
|
-
const i = {};
|
|
195
|
-
for (let l = 0; l <= e.e.c; l++)
|
|
196
|
-
for (let s = t; s <= o; s++) {
|
|
197
|
-
const d = J(Y(n, s, l));
|
|
198
|
-
if (d != null && i[d] === void 0) {
|
|
199
|
-
i[d] = l;
|
|
200
|
-
break;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
return i;
|
|
204
|
-
}
|
|
205
|
-
for (let t = 0; t <= c; t++) {
|
|
206
|
-
const o = a(t, t);
|
|
207
|
-
if (r.every((i) => o[i] != null))
|
|
208
|
-
return {
|
|
209
|
-
headerRow: t,
|
|
210
|
-
cols: T(o)
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
for (let t = 0; t <= Math.min(c - 1, e.e.r - 1); t++) {
|
|
214
|
-
const o = a(t, t + 1);
|
|
215
|
-
if (r.every((i) => o[i] != null))
|
|
216
|
-
return {
|
|
217
|
-
headerRow: t + 1,
|
|
218
|
-
cols: T(o)
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
return null;
|
|
222
|
-
}
|
|
223
|
-
function T(n) {
|
|
224
|
-
var e;
|
|
225
|
-
return {
|
|
226
|
-
std: (e = n.std) != null ? e : -1,
|
|
227
|
-
name: n.name,
|
|
228
|
-
ruleGuide: n.ruleGuide,
|
|
229
|
-
periodNum: n.periodNum,
|
|
230
|
-
periodUnit: n.periodUnit,
|
|
231
|
-
periodFreq: n.periodFreq,
|
|
232
|
-
type: n.type
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
const X = {
|
|
236
|
-
std: 0,
|
|
237
|
-
name: 2,
|
|
238
|
-
ruleGuide: 3,
|
|
239
|
-
periodNum: 4,
|
|
240
|
-
periodUnit: 5,
|
|
241
|
-
periodFreq: 6,
|
|
242
|
-
type: 7
|
|
243
|
-
};
|
|
244
|
-
function Z(n) {
|
|
245
|
-
const e = [];
|
|
246
|
-
return Object.keys(n.Sheets).forEach((c) => {
|
|
247
|
-
var g, S, C;
|
|
248
|
-
const r = n.Sheets[c], a = r["!ref"];
|
|
249
|
-
if (!a) return;
|
|
250
|
-
const t = u.decode_range(a), o = Q(r, t), i = (g = o == null ? void 0 : o.cols) != null ? g : X, l = o != null ? o.headerRow + 1 : z(r);
|
|
251
|
-
let s = c.trim();
|
|
252
|
-
const d = [];
|
|
253
|
-
for (let m = l; m <= t.e.r; m++) {
|
|
254
|
-
if (i.std >= 0) {
|
|
255
|
-
const _ = r[u.encode_cell({ r: m, c: i.std })];
|
|
256
|
-
_ && _.v && (s = String(_.v));
|
|
257
|
-
}
|
|
258
|
-
if (!s) continue;
|
|
259
|
-
const p = r[u.encode_cell({ r: m, c: i.name })], E = r[u.encode_cell({ r: m, c: i.ruleGuide })], f = r[u.encode_cell({ r: m, c: i.periodNum })], F = r[u.encode_cell({ r: m, c: i.periodUnit })], b = r[u.encode_cell({ r: m, c: i.periodFreq })], I = r[u.encode_cell({ r: m, c: i.type })];
|
|
260
|
-
if (!p || !p.v || !E || !E.v || !f || !f.v || !F || !F.v || !b || !b.v || !I || !I.v)
|
|
261
|
-
continue;
|
|
262
|
-
const y = [];
|
|
263
|
-
let h = i.type + 1;
|
|
264
|
-
for (; h <= t.e.c; ) {
|
|
265
|
-
const _ = r[u.encode_cell({ r: m, c: h })];
|
|
266
|
-
if (_ && _.v)
|
|
267
|
-
y.push(_.v), h++;
|
|
268
|
-
else
|
|
269
|
-
break;
|
|
270
|
-
}
|
|
271
|
-
let v = null;
|
|
272
|
-
switch (W(I.v)) {
|
|
273
|
-
case "文本":
|
|
274
|
-
v = {
|
|
275
|
-
type: "text",
|
|
276
|
-
value: []
|
|
277
|
-
};
|
|
278
|
-
break;
|
|
279
|
-
case "布尔":
|
|
280
|
-
v = {
|
|
281
|
-
type: "boolean",
|
|
282
|
-
value: {
|
|
283
|
-
true: (S = y[0]) != null ? S : "是",
|
|
284
|
-
false: (C = y[1]) != null ? C : "否"
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
|
-
break;
|
|
288
|
-
case "单选":
|
|
289
|
-
y.length >= 2 && (v = {
|
|
290
|
-
type: "radio",
|
|
291
|
-
value: y.map((_) => ({ value: _ }))
|
|
292
|
-
});
|
|
293
|
-
break;
|
|
294
|
-
case "多选":
|
|
295
|
-
y.length >= 2 && (v = {
|
|
296
|
-
type: "multi",
|
|
297
|
-
value: y.map((_) => ({ value: _ }))
|
|
298
|
-
});
|
|
299
|
-
break;
|
|
300
|
-
}
|
|
301
|
-
if (!v) continue;
|
|
302
|
-
const N = {
|
|
303
|
-
name: p.v,
|
|
304
|
-
rule_guide: E.v,
|
|
305
|
-
period_num: typeof f.v == "number" ? f.v : parseFloat(String(f.v)),
|
|
306
|
-
period_unit: F.v,
|
|
307
|
-
period_frequency: typeof b.v == "number" ? b.v : parseFloat(String(b.v)),
|
|
308
|
-
option: v
|
|
309
|
-
};
|
|
310
|
-
d.push(N);
|
|
311
|
-
}
|
|
312
|
-
d.length > 0 && e.push({
|
|
313
|
-
name: c,
|
|
314
|
-
serial_num: s,
|
|
315
|
-
data: d
|
|
316
|
-
});
|
|
317
|
-
}), e;
|
|
318
|
-
}
|
|
319
|
-
export {
|
|
320
|
-
re as useImportExcellFromFrontend
|
|
321
|
-
};
|