@fecp/designer 5.5.105 → 5.5.108
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/es/_virtual/exceljs.min.mjs +7 -0
- package/es/_virtual/exceljs.min2.mjs +4 -0
- package/es/designer/package.json.mjs +1 -1
- package/es/designer/src/packages/dialog/useDialogDialog.mjs +1 -1
- package/es/designer/src/packages/dialogGlobal/useDialogGlobalDialog.mjs +1 -1
- package/es/designer/src/packages/form/property/widgets.vue.mjs +2 -2
- package/es/designer.css +126 -95
- package/es/node_modules/@vxe-ui/plugin-export-xlsx/es/index.esm.mjs +809 -0
- package/es/node_modules/exceljs/dist/exceljs.min.mjs +23129 -0
- package/es/packages/mobile/node_modules/vant/es/tag/Tag.mjs +80 -0
- package/es/packages/mobile/node_modules/vant/es/tag/index.mjs +8 -0
- package/es/packages/mobile/src/components/custom/approvalList/ApprovalCard.vue.mjs +139 -0
- package/es/packages/mobile/src/components/custom/approvalList/ApprovalList.vue.mjs +116 -300
- package/es/packages/vue/index.mjs +6 -1
- package/es/packages/vue/src/components/layout/Layout.vue.mjs +8 -3
- package/es/packages/vue/src/components/table/Table.vue.mjs +125 -4
- package/es/packages/vue/src/components/table/TableColumn.vue.mjs +6 -115
- package/lib/_virtual/exceljs.min.js +7 -0
- package/lib/_virtual/exceljs.min2.js +4 -0
- package/lib/designer/package.json.js +1 -1
- package/lib/designer/src/packages/dialog/useDialogDialog.js +1 -1
- package/lib/designer/src/packages/dialogGlobal/useDialogGlobalDialog.js +1 -1
- package/lib/designer/src/packages/form/property/widgets.vue.js +2 -2
- package/lib/designer.css +126 -95
- package/lib/node_modules/@vxe-ui/plugin-export-xlsx/es/index.esm.js +809 -0
- package/lib/node_modules/exceljs/dist/exceljs.min.js +23129 -0
- package/lib/packages/mobile/node_modules/vant/es/tag/Tag.js +80 -0
- package/lib/packages/mobile/node_modules/vant/es/tag/index.js +7 -0
- package/lib/packages/mobile/src/components/custom/approvalList/ApprovalCard.vue.js +139 -0
- package/lib/packages/mobile/src/components/custom/approvalList/ApprovalList.vue.js +119 -303
- package/lib/packages/vue/index.js +5 -0
- package/lib/packages/vue/src/components/layout/Layout.vue.js +8 -3
- package/lib/packages/vue/src/components/table/Table.vue.js +125 -4
- package/lib/packages/vue/src/components/table/TableColumn.vue.js +6 -115
- package/package.json +1 -1
|
@@ -43,6 +43,7 @@ const _pluginVue_exportHelper = require("../../../../../_virtual/_plugin-vue_exp
|
|
|
43
43
|
;/* empty css */
|
|
44
44
|
const getJsonAsyncUtil = require("../../utils/getJsonAsyncUtil.js");
|
|
45
45
|
const eventBus = require("../../utils/eventBus.js");
|
|
46
|
+
const decimal = require("../../../../../node_modules/decimal.js/decimal.js");
|
|
46
47
|
;/* empty css */
|
|
47
48
|
const index = require("../../../../../node_modules/element-plus/es/components/container/index.js");
|
|
48
49
|
const index$1 = require("../../../../../node_modules/element-plus/es/components/message/index.js");
|
|
@@ -696,9 +697,18 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
696
697
|
}
|
|
697
698
|
}
|
|
698
699
|
const exportConfig = Vue.reactive({
|
|
699
|
-
|
|
700
|
-
|
|
700
|
+
type: "xlsx",
|
|
701
|
+
types: ["csv", "html", "xml", "txt", "xlsx"],
|
|
702
|
+
modes: ["current", "all", "empty"],
|
|
703
|
+
original: false,
|
|
704
|
+
excludeFields: ["operationCol"],
|
|
705
|
+
beforeExportMethod: ({ options }) => {
|
|
706
|
+
if (options.mode == "all") ;
|
|
707
|
+
}
|
|
701
708
|
});
|
|
709
|
+
if (props.selectMode == "multiple" || localConfig.value.selectMode == "multiple") {
|
|
710
|
+
exportConfig.modes = ["current", "selected", "all", "empty"];
|
|
711
|
+
}
|
|
702
712
|
const handleExport = () => {
|
|
703
713
|
const $table = tableRef.value;
|
|
704
714
|
if ($table) {
|
|
@@ -848,6 +858,116 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
848
858
|
},
|
|
849
859
|
{ deep: true }
|
|
850
860
|
);
|
|
861
|
+
const formatCellValue = (row, field) => {
|
|
862
|
+
const value = row[field.fieldName];
|
|
863
|
+
if (value === null || value === void 0) return "";
|
|
864
|
+
switch (field.fieldType) {
|
|
865
|
+
case "number":
|
|
866
|
+
let numValue = Number(value);
|
|
867
|
+
if (isNaN(numValue)) return value;
|
|
868
|
+
switch (field.format) {
|
|
869
|
+
case "wan":
|
|
870
|
+
numValue = new decimal.Decimal(numValue).div(new decimal.Decimal(1e4)).toNumber();
|
|
871
|
+
break;
|
|
872
|
+
case "million":
|
|
873
|
+
numValue = new decimal.Decimal(numValue).div(new decimal.Decimal(1e6)).toNumber();
|
|
874
|
+
break;
|
|
875
|
+
case "percentage":
|
|
876
|
+
numValue = new decimal.Decimal(numValue).mul(new decimal.Decimal(100)).toNumber();
|
|
877
|
+
break;
|
|
878
|
+
case "permillage":
|
|
879
|
+
numValue = new decimal.Decimal(numValue).mul(new decimal.Decimal(1e3)).toNumber();
|
|
880
|
+
break;
|
|
881
|
+
case "permillion":
|
|
882
|
+
numValue = new decimal.Decimal(numValue).mul(new decimal.Decimal(1e4)).toNumber();
|
|
883
|
+
break;
|
|
884
|
+
}
|
|
885
|
+
if (field.hasDecimalPlaces && field.decimalPlaces !== void 0) {
|
|
886
|
+
numValue = Number(numValue.toFixed(field.decimalPlaces));
|
|
887
|
+
}
|
|
888
|
+
if (field.format == "yuan" || field.format == "wan" || field.format == "million") {
|
|
889
|
+
const formatted = numValue.toLocaleString("en-US", {
|
|
890
|
+
minimumFractionDigits: field.hasDecimalPlaces && field.decimalPlaces !== void 0 ? field.decimalPlaces : 0,
|
|
891
|
+
maximumFractionDigits: field.hasDecimalPlaces && field.decimalPlaces !== void 0 ? field.decimalPlaces : 20
|
|
892
|
+
});
|
|
893
|
+
return formatted;
|
|
894
|
+
}
|
|
895
|
+
return numValue;
|
|
896
|
+
case "select":
|
|
897
|
+
case "multipleSelection":
|
|
898
|
+
if (field.optionConfig) {
|
|
899
|
+
let options = [];
|
|
900
|
+
let displayField = "label";
|
|
901
|
+
let valueField = "value";
|
|
902
|
+
if (field.optionConfig.optionSource === "custom" && field.optionConfig.options) {
|
|
903
|
+
options = field.optionConfig.options;
|
|
904
|
+
displayField = "label";
|
|
905
|
+
valueField = "value";
|
|
906
|
+
} else if (field.optionConfig.optionSource === "dataSource" && field.optionConfig.dataSourceValue) {
|
|
907
|
+
options = dataSourceOptions.value[field.optionConfig.dataSourceValue] || [];
|
|
908
|
+
displayField = field.optionConfig.displayField || "label";
|
|
909
|
+
valueField = field.optionConfig.valueField || "value";
|
|
910
|
+
} else if (field.optionConfig.optionSource === "dictionary" && field.optionConfig.dictionaryValue) {
|
|
911
|
+
options = dictionaryOptions.value[field.optionConfig.dictionaryValue] || [];
|
|
912
|
+
displayField = "optName";
|
|
913
|
+
valueField = "optCode";
|
|
914
|
+
}
|
|
915
|
+
if (typeof value === "string" && value.includes("|")) {
|
|
916
|
+
const values = value.split("|");
|
|
917
|
+
const displayValues = values.map((val) => {
|
|
918
|
+
const option2 = options.find((opt) => opt[valueField] == val);
|
|
919
|
+
return option2 ? option2[displayField] : val;
|
|
920
|
+
});
|
|
921
|
+
return displayValues.join(", ");
|
|
922
|
+
}
|
|
923
|
+
const option = options.find((opt) => opt[valueField] == value);
|
|
924
|
+
return option ? option[displayField] : value;
|
|
925
|
+
}
|
|
926
|
+
return value;
|
|
927
|
+
case "date":
|
|
928
|
+
return formatDate(value, field.dateType);
|
|
929
|
+
case "switch":
|
|
930
|
+
return value ? "是" : "否";
|
|
931
|
+
default:
|
|
932
|
+
return value;
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
const formatDate = (value, type) => {
|
|
936
|
+
if (!value) return "";
|
|
937
|
+
let date;
|
|
938
|
+
if (typeof value === "string" && /^\d{8}$/.test(value)) {
|
|
939
|
+
const year2 = value.substring(0, 4);
|
|
940
|
+
const month2 = value.substring(4, 6);
|
|
941
|
+
const day2 = value.substring(6, 8);
|
|
942
|
+
date = /* @__PURE__ */ new Date(`${year2}-${month2}-${day2}`);
|
|
943
|
+
} else {
|
|
944
|
+
date = new Date(value);
|
|
945
|
+
}
|
|
946
|
+
if (isNaN(date.getTime())) return value;
|
|
947
|
+
const year = date.getFullYear();
|
|
948
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
949
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
950
|
+
const hours = String(date.getHours()).padStart(2, "0");
|
|
951
|
+
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
952
|
+
const seconds = String(date.getSeconds()).padStart(2, "0");
|
|
953
|
+
const getWeekNumber = (d) => {
|
|
954
|
+
const oneJan = new Date(d.getFullYear(), 0, 1);
|
|
955
|
+
const numberOfDays = Math.floor((d - oneJan) / (24 * 60 * 60 * 1e3));
|
|
956
|
+
return Math.ceil((d.getDay() + 1 + numberOfDays) / 7);
|
|
957
|
+
};
|
|
958
|
+
const week = getWeekNumber(date);
|
|
959
|
+
const formatMap = {
|
|
960
|
+
date: `${year}-${month}-${day}`,
|
|
961
|
+
"datetime-minute": `${year}-${month}-${day} ${hours}:${minutes}`,
|
|
962
|
+
datetime: `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`,
|
|
963
|
+
time: `${hours}:${minutes}:${seconds}`,
|
|
964
|
+
year: `${year}`,
|
|
965
|
+
month: `${year}-${month}`,
|
|
966
|
+
week: `${year}-${week}`,
|
|
967
|
+
dates: `${year}-${month}-${day}`
|
|
968
|
+
};
|
|
969
|
+
return formatMap[type] || formatMap.date;
|
|
970
|
+
};
|
|
851
971
|
Vue.onUnmounted(() => {
|
|
852
972
|
if (dataSourceManager.value) {
|
|
853
973
|
dataSourceManager.value.destroy();
|
|
@@ -960,7 +1080,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
960
1080
|
readonly: __props.readonly,
|
|
961
1081
|
isDialog: __props.isDialog,
|
|
962
1082
|
hiddenFormData: hiddenFormData.value,
|
|
963
|
-
btnRollbackEvent: __props.btnRollbackEvent
|
|
1083
|
+
btnRollbackEvent: __props.btnRollbackEvent,
|
|
1084
|
+
formatCellValue
|
|
964
1085
|
}, Vue.createSlots({ _: 2 }, [
|
|
965
1086
|
Vue.renderList(fieldsData.value, (field) => {
|
|
966
1087
|
return {
|
|
@@ -990,5 +1111,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
990
1111
|
};
|
|
991
1112
|
}
|
|
992
1113
|
});
|
|
993
|
-
const _Table = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-
|
|
1114
|
+
const _Table = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-199fae66"]]);
|
|
994
1115
|
exports.default = _Table;
|
|
@@ -30,7 +30,6 @@ const _pluginVue_exportHelper = require("../../../../../_virtual/_plugin-vue_exp
|
|
|
30
30
|
;/* empty css */
|
|
31
31
|
;/* empty css */
|
|
32
32
|
;/* empty css */
|
|
33
|
-
const decimal = require("../../../../../node_modules/decimal.js/decimal.js");
|
|
34
33
|
;/* empty css */
|
|
35
34
|
const index = require("../../../../../node_modules/element-plus/es/components/link/index.js");
|
|
36
35
|
const index$1 = require("../../../../../node_modules/element-plus/es/components/icon/index.js");
|
|
@@ -117,7 +116,8 @@ const _sfc_main = {
|
|
|
117
116
|
btnRollbackEvent: {
|
|
118
117
|
type: Object,
|
|
119
118
|
default: {}
|
|
120
|
-
}
|
|
119
|
+
},
|
|
120
|
+
formatCellValue: Function
|
|
121
121
|
},
|
|
122
122
|
setup(__props) {
|
|
123
123
|
const props = __props;
|
|
@@ -140,116 +140,6 @@ const _sfc_main = {
|
|
|
140
140
|
}
|
|
141
141
|
return field.width;
|
|
142
142
|
};
|
|
143
|
-
const formatCellValue = (row, field) => {
|
|
144
|
-
const value = row[field.fieldName];
|
|
145
|
-
if (value === null || value === void 0) return "";
|
|
146
|
-
switch (field.fieldType) {
|
|
147
|
-
case "number":
|
|
148
|
-
let numValue = Number(value);
|
|
149
|
-
if (isNaN(numValue)) return value;
|
|
150
|
-
switch (field.format) {
|
|
151
|
-
case "wan":
|
|
152
|
-
numValue = new decimal.Decimal(numValue).div(new decimal.Decimal(1e4)).toNumber();
|
|
153
|
-
break;
|
|
154
|
-
case "million":
|
|
155
|
-
numValue = new decimal.Decimal(numValue).div(new decimal.Decimal(1e6)).toNumber();
|
|
156
|
-
break;
|
|
157
|
-
case "percentage":
|
|
158
|
-
numValue = new decimal.Decimal(numValue).mul(new decimal.Decimal(100)).toNumber();
|
|
159
|
-
break;
|
|
160
|
-
case "permillage":
|
|
161
|
-
numValue = new decimal.Decimal(numValue).mul(new decimal.Decimal(1e3)).toNumber();
|
|
162
|
-
break;
|
|
163
|
-
case "permillion":
|
|
164
|
-
numValue = new decimal.Decimal(numValue).mul(new decimal.Decimal(1e4)).toNumber();
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
if (field.hasDecimalPlaces && field.decimalPlaces !== void 0) {
|
|
168
|
-
numValue = Number(numValue.toFixed(field.decimalPlaces));
|
|
169
|
-
}
|
|
170
|
-
if (field.format == "yuan" || field.format == "wan" || field.format == "million") {
|
|
171
|
-
const formatted = numValue.toLocaleString("en-US", {
|
|
172
|
-
minimumFractionDigits: field.hasDecimalPlaces && field.decimalPlaces !== void 0 ? field.decimalPlaces : 0,
|
|
173
|
-
maximumFractionDigits: field.hasDecimalPlaces && field.decimalPlaces !== void 0 ? field.decimalPlaces : 20
|
|
174
|
-
});
|
|
175
|
-
return formatted;
|
|
176
|
-
}
|
|
177
|
-
return numValue;
|
|
178
|
-
case "select":
|
|
179
|
-
case "multipleSelection":
|
|
180
|
-
if (field.optionConfig) {
|
|
181
|
-
let options = [];
|
|
182
|
-
let displayField = "label";
|
|
183
|
-
let valueField = "value";
|
|
184
|
-
if (field.optionConfig.optionSource === "custom" && field.optionConfig.options) {
|
|
185
|
-
options = field.optionConfig.options;
|
|
186
|
-
displayField = "label";
|
|
187
|
-
valueField = "value";
|
|
188
|
-
} else if (field.optionConfig.optionSource === "dataSource" && field.optionConfig.dataSourceValue) {
|
|
189
|
-
options = props.dataSourceOptions[field.optionConfig.dataSourceValue] || [];
|
|
190
|
-
displayField = field.optionConfig.displayField || "label";
|
|
191
|
-
valueField = field.optionConfig.valueField || "value";
|
|
192
|
-
} else if (field.optionConfig.optionSource === "dictionary" && field.optionConfig.dictionaryValue) {
|
|
193
|
-
options = props.dictionaryOptions[field.optionConfig.dictionaryValue] || [];
|
|
194
|
-
displayField = "optName";
|
|
195
|
-
valueField = "optCode";
|
|
196
|
-
}
|
|
197
|
-
if (typeof value === "string" && value.includes("|")) {
|
|
198
|
-
const values = value.split("|");
|
|
199
|
-
const displayValues = values.map((val) => {
|
|
200
|
-
const option2 = options.find((opt) => opt[valueField] == val);
|
|
201
|
-
return option2 ? option2[displayField] : val;
|
|
202
|
-
});
|
|
203
|
-
return displayValues.join(", ");
|
|
204
|
-
}
|
|
205
|
-
const option = options.find((opt) => opt[valueField] == value);
|
|
206
|
-
return option ? option[displayField] : value;
|
|
207
|
-
}
|
|
208
|
-
return value;
|
|
209
|
-
case "date":
|
|
210
|
-
return formatDate(value, field.dateType);
|
|
211
|
-
case "switch":
|
|
212
|
-
return value ? "是" : "否";
|
|
213
|
-
default:
|
|
214
|
-
return value;
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
const formatDate = (value, type) => {
|
|
218
|
-
if (!value) return "";
|
|
219
|
-
let date;
|
|
220
|
-
if (typeof value === "string" && /^\d{8}$/.test(value)) {
|
|
221
|
-
const year2 = value.substring(0, 4);
|
|
222
|
-
const month2 = value.substring(4, 6);
|
|
223
|
-
const day2 = value.substring(6, 8);
|
|
224
|
-
date = /* @__PURE__ */ new Date(`${year2}-${month2}-${day2}`);
|
|
225
|
-
} else {
|
|
226
|
-
date = new Date(value);
|
|
227
|
-
}
|
|
228
|
-
if (isNaN(date.getTime())) return value;
|
|
229
|
-
const year = date.getFullYear();
|
|
230
|
-
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
231
|
-
const day = String(date.getDate()).padStart(2, "0");
|
|
232
|
-
const hours = String(date.getHours()).padStart(2, "0");
|
|
233
|
-
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
234
|
-
const seconds = String(date.getSeconds()).padStart(2, "0");
|
|
235
|
-
const getWeekNumber = (d) => {
|
|
236
|
-
const oneJan = new Date(d.getFullYear(), 0, 1);
|
|
237
|
-
const numberOfDays = Math.floor((d - oneJan) / (24 * 60 * 60 * 1e3));
|
|
238
|
-
return Math.ceil((d.getDay() + 1 + numberOfDays) / 7);
|
|
239
|
-
};
|
|
240
|
-
const week = getWeekNumber(date);
|
|
241
|
-
const formatMap = {
|
|
242
|
-
date: `${year}-${month}-${day}`,
|
|
243
|
-
"datetime-minute": `${year}-${month}-${day} ${hours}:${minutes}`,
|
|
244
|
-
datetime: `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`,
|
|
245
|
-
time: `${hours}:${minutes}:${seconds}`,
|
|
246
|
-
year: `${year}`,
|
|
247
|
-
month: `${year}-${month}`,
|
|
248
|
-
week: `${year}-${week}`,
|
|
249
|
-
dates: `${year}-${month}-${day}`
|
|
250
|
-
};
|
|
251
|
-
return formatMap[type] || formatMap.date;
|
|
252
|
-
};
|
|
253
143
|
const handleCopy = (row, field) => {
|
|
254
144
|
const value = row[field.fieldName];
|
|
255
145
|
navigator.clipboard.writeText(value).then(() => {
|
|
@@ -399,11 +289,11 @@ const _sfc_main = {
|
|
|
399
289
|
onClick: ($event) => handleButtonClick(row, field, field.linkConfig)
|
|
400
290
|
}, {
|
|
401
291
|
default: Vue.withCtx(() => [
|
|
402
|
-
Vue.createTextVNode(Vue.toDisplayString(formatCellValue(row, field)), 1)
|
|
292
|
+
Vue.createTextVNode(Vue.toDisplayString(__props.formatCellValue(row, field)), 1)
|
|
403
293
|
]),
|
|
404
294
|
_: 2
|
|
405
295
|
}, 1032, ["onClick"])) : (Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, { key: 2 }, [
|
|
406
|
-
Vue.createTextVNode(Vue.toDisplayString(formatCellValue(row, field)), 1)
|
|
296
|
+
Vue.createTextVNode(Vue.toDisplayString(__props.formatCellValue(row, field)), 1)
|
|
407
297
|
], 64)),
|
|
408
298
|
field.suffix ? (Vue.openBlock(), Vue.createElementBlock("span", _hoisted_3, Vue.toDisplayString(field.suffix), 1)) : Vue.createCommentVNode("", true),
|
|
409
299
|
field.canCopy ? (Vue.openBlock(), Vue.createBlock(_component_el_icon, {
|
|
@@ -423,6 +313,7 @@ const _sfc_main = {
|
|
|
423
313
|
}), 128)),
|
|
424
314
|
!__props.readonly && shouldShowOptColumn.value ? (Vue.openBlock(), Vue.createBlock(Vue.unref(vxeTable.VxeColumn), {
|
|
425
315
|
key: 3,
|
|
316
|
+
field: "operationCol",
|
|
426
317
|
title: "操作",
|
|
427
318
|
width: optColumnWidth.value,
|
|
428
319
|
fixed: "right",
|
|
@@ -450,5 +341,5 @@ const _sfc_main = {
|
|
|
450
341
|
};
|
|
451
342
|
}
|
|
452
343
|
};
|
|
453
|
-
const TableColumn = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-
|
|
344
|
+
const TableColumn = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-336afafd"]]);
|
|
454
345
|
exports.default = TableColumn;
|