@fecp/designer 5.5.120 → 5.5.121
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/designer/package.json.mjs +1 -1
- package/es/designer/src/packages/dataSource/index.vue.mjs +3 -3
- package/es/designer/src/packages/dialog/index.vue2.mjs +15 -15
- package/es/designer/src/packages/dialog/useDialogDialog.mjs +1 -1
- package/es/designer/src/packages/dialogGlobal/index.vue2.mjs +15 -16
- package/es/designer/src/packages/dialogGlobal/useDialogGlobalDialog.mjs +1 -1
- package/es/designer/src/packages/event/pageEvent.vue.mjs +1 -1
- package/es/designer/src/packages/form/index.vue.mjs +2 -2
- package/es/designer/src/packages/form/property/widgets.vue.mjs +2 -2
- package/es/designer.css +505 -415
- package/es/packages/mobile/index.mjs +2 -0
- package/es/packages/mobile/src/api/index.mjs +1 -1
- package/es/packages/mobile/src/assets/images/baseRate.png.mjs +1 -1
- package/es/packages/mobile/src/assets/images/home-bg.png.mjs +1 -1
- package/es/packages/mobile/src/assets/images/rentCalc.png.mjs +1 -1
- package/es/packages/mobile/src/assets/images/user.png.mjs +4 -0
- package/es/packages/mobile/src/components/all.mjs +2 -0
- package/es/packages/mobile/src/components/base/card/Card.vue.mjs +2 -2
- package/es/packages/mobile/src/components/custom/appDetail/AppDetail.vue.mjs +62 -44
- package/es/packages/mobile/src/components/custom/appTimeLine/AppTimeLine.vue.mjs +2 -2
- package/es/packages/mobile/src/components/custom/approvalBar/ApprovalBar.vue.mjs +128 -67
- package/es/packages/mobile/src/components/custom/approvalList/ApprovalList.vue.mjs +5 -5
- package/es/packages/mobile/src/components/custom/customCode/CustomCode.vue.mjs +60 -0
- package/es/packages/mobile/src/components/custom/customCode/index.mjs +10 -0
- package/es/packages/mobile/src/components/custom/document/Document.vue.mjs +2 -2
- package/es/packages/mobile/src/components/custom/userSelect/UserSelect.vue.mjs +2 -2
- package/es/packages/mobile/src/components/dataDisplay/cardList/CardList.vue.mjs +187 -7
- package/es/packages/mobile/src/components/dataDisplay/dataStat/DataStat.vue.mjs +2 -2
- package/es/packages/mobile/src/components/dataDisplay/mine/Mine.vue.mjs +33 -9
- package/es/packages/mobile/src/components/dataDisplay/rentCalcResult/RentCalcResult.vue.mjs +39 -79
- package/es/packages/mobile/src/components/feedback/quickFilter/QuickFilter.vue.mjs +10 -2
- package/es/packages/mobile/src/components/form/field/Field.vue.mjs +167 -32
- package/es/packages/mobile/src/components/form/fieldArea/FieldArea.vue.mjs +3 -2
- package/es/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.mjs +13 -15
- package/es/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.mjs +10 -10
- package/es/packages/mobile/src/components/form/fieldCheckbox/FieldCheckbox.vue.mjs +7 -23
- package/es/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.mjs +14 -26
- package/es/packages/mobile/src/components/form/fieldDateTimePicker/FieldDateTimePicker.vue.mjs +14 -15
- package/es/packages/mobile/src/components/form/fieldIndustry/FieldIndustry.vue.mjs +6 -19
- package/es/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.mjs +9 -25
- package/es/packages/mobile/src/components/form/fieldRadio/FieldRadio.vue.mjs +8 -24
- package/es/packages/mobile/src/components/form/search/Search.vue.mjs +15 -6
- package/es/packages/mobile/src/components/form/uploader/Uploader.vue.mjs +2 -2
- package/es/packages/mobile/src/components/navigation/tabbar/Tabbar.vue.mjs +9 -5
- package/es/packages/mobile/src/components/navigation/tabs/Tabs.vue.mjs +58 -25
- package/es/packages/mobile/src/index.vue.mjs +21 -4
- package/es/packages/mobile/src/page.vue.mjs +342 -138
- package/es/packages/mobile/src/utils/common.mjs +21 -0
- package/es/packages/mobile/src/utils/datasource.mjs +3 -3
- package/es/packages/mobile/src/utils/eventFlow/actionHandlers.mjs +35 -22
- package/es/packages/mobile/src/utils/formatterUtil.mjs +4 -24
- package/es/packages/mobile/src/utils/formulajs/calculate.mjs +11 -5
- package/es/packages/mobile/src/utils/optionUtil.mjs +3 -28
- package/es/packages/mobile/src/utils/pageHistory.mjs +16 -0
- package/es/packages/mobile/src/utils/validation.mjs +129 -0
- package/es/packages/vue/src/components/forms/number/Number.vue.mjs +3 -2
- package/es/packages/vue/src/components/table/TableColumn.vue.mjs +12 -8
- package/lib/designer/package.json.js +1 -1
- package/lib/designer/src/packages/dataSource/index.vue.js +3 -3
- package/lib/designer/src/packages/dialog/index.vue2.js +15 -15
- package/lib/designer/src/packages/dialog/useDialogDialog.js +1 -1
- package/lib/designer/src/packages/dialogGlobal/index.vue2.js +15 -16
- package/lib/designer/src/packages/dialogGlobal/useDialogGlobalDialog.js +1 -1
- package/lib/designer/src/packages/event/pageEvent.vue.js +1 -1
- package/lib/designer/src/packages/form/index.vue.js +2 -2
- package/lib/designer/src/packages/form/property/widgets.vue.js +2 -2
- package/lib/designer.css +505 -415
- package/lib/packages/mobile/index.js +4 -2
- package/lib/packages/mobile/src/api/index.js +1 -1
- package/lib/packages/mobile/src/assets/images/baseRate.png.js +1 -1
- package/lib/packages/mobile/src/assets/images/home-bg.png.js +1 -1
- package/lib/packages/mobile/src/assets/images/rentCalc.png.js +1 -1
- package/lib/packages/mobile/src/assets/images/user.png.js +4 -0
- package/lib/packages/mobile/src/components/all.js +2 -0
- package/lib/packages/mobile/src/components/base/card/Card.vue.js +2 -2
- package/lib/packages/mobile/src/components/custom/appDetail/AppDetail.vue.js +61 -43
- package/lib/packages/mobile/src/components/custom/appTimeLine/AppTimeLine.vue.js +2 -2
- package/lib/packages/mobile/src/components/custom/approvalBar/ApprovalBar.vue.js +131 -70
- package/lib/packages/mobile/src/components/custom/approvalList/ApprovalList.vue.js +5 -5
- package/lib/packages/mobile/src/components/custom/customCode/CustomCode.vue.js +60 -0
- package/lib/packages/mobile/src/components/custom/customCode/index.js +10 -0
- package/lib/packages/mobile/src/components/custom/document/Document.vue.js +2 -2
- package/lib/packages/mobile/src/components/custom/userSelect/UserSelect.vue.js +2 -2
- package/lib/packages/mobile/src/components/dataDisplay/cardList/CardList.vue.js +187 -7
- package/lib/packages/mobile/src/components/dataDisplay/dataStat/DataStat.vue.js +2 -2
- package/lib/packages/mobile/src/components/dataDisplay/mine/Mine.vue.js +38 -14
- package/lib/packages/mobile/src/components/dataDisplay/rentCalcResult/RentCalcResult.vue.js +39 -79
- package/lib/packages/mobile/src/components/feedback/quickFilter/QuickFilter.vue.js +10 -2
- package/lib/packages/mobile/src/components/form/field/Field.vue.js +165 -30
- package/lib/packages/mobile/src/components/form/fieldArea/FieldArea.vue.js +3 -2
- package/lib/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.js +13 -15
- package/lib/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.js +9 -9
- package/lib/packages/mobile/src/components/form/fieldCheckbox/FieldCheckbox.vue.js +6 -22
- package/lib/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.js +13 -25
- package/lib/packages/mobile/src/components/form/fieldDateTimePicker/FieldDateTimePicker.vue.js +13 -14
- package/lib/packages/mobile/src/components/form/fieldIndustry/FieldIndustry.vue.js +6 -19
- package/lib/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.js +8 -24
- package/lib/packages/mobile/src/components/form/fieldRadio/FieldRadio.vue.js +7 -23
- package/lib/packages/mobile/src/components/form/search/Search.vue.js +15 -6
- package/lib/packages/mobile/src/components/form/uploader/Uploader.vue.js +2 -2
- package/lib/packages/mobile/src/components/navigation/tabbar/Tabbar.vue.js +9 -5
- package/lib/packages/mobile/src/components/navigation/tabs/Tabs.vue.js +61 -28
- package/lib/packages/mobile/src/index.vue.js +20 -3
- package/lib/packages/mobile/src/page.vue.js +341 -137
- package/lib/packages/mobile/src/utils/common.js +21 -0
- package/lib/packages/mobile/src/utils/datasource.js +3 -3
- package/lib/packages/mobile/src/utils/eventFlow/actionHandlers.js +35 -22
- package/lib/packages/mobile/src/utils/formatterUtil.js +3 -23
- package/lib/packages/mobile/src/utils/formulajs/calculate.js +11 -5
- package/lib/packages/mobile/src/utils/optionUtil.js +2 -27
- package/lib/packages/mobile/src/utils/pageHistory.js +16 -0
- package/lib/packages/mobile/src/utils/validation.js +129 -0
- package/lib/packages/vue/src/components/forms/number/Number.vue.js +3 -2
- package/lib/packages/vue/src/components/table/TableColumn.vue.js +12 -8
- package/package.json +1 -1
|
@@ -70,7 +70,7 @@ class DataSourceManager {
|
|
|
70
70
|
if (this.sortRules && this.sortRules.length > 0) {
|
|
71
71
|
params.sortRules = JSON.stringify(this.sortRules);
|
|
72
72
|
}
|
|
73
|
-
return { ...this.initSearchData, ...params, ...extraParams };
|
|
73
|
+
return { ...this.initSearchData, ...params, ...extraParams, isMobile: true };
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* 根据内容类型处理请求数据
|
|
@@ -157,13 +157,13 @@ class DataSourceManager {
|
|
|
157
157
|
break;
|
|
158
158
|
case "post":
|
|
159
159
|
if (currentDs.contentType === "formData") {
|
|
160
|
-
response = await this.http.
|
|
160
|
+
response = await this.http.postFormMobile(url, params, false, false);
|
|
161
161
|
} else if (currentDs.contentType === "download") {
|
|
162
162
|
await this.http.download(url, params, false);
|
|
163
163
|
} else if (currentDs.contentType === "upload") {
|
|
164
164
|
response = await this.http.upload(url, params, false);
|
|
165
165
|
} else {
|
|
166
|
-
response = await this.http.
|
|
166
|
+
response = await this.http.postMobile(url, params, false);
|
|
167
167
|
}
|
|
168
168
|
break;
|
|
169
169
|
case "put":
|
|
@@ -12,9 +12,17 @@ require("../../../../../node_modules/element-plus/es/index.js");
|
|
|
12
12
|
;/* empty css */
|
|
13
13
|
;/* empty css */
|
|
14
14
|
const index = require("../../../../../node_modules/element-plus/es/components/message-box/index.js");
|
|
15
|
+
const functionCall = require("../../../../../node_modules/vant/es/toast/function-call.js");
|
|
16
|
+
require("../../../../../node_modules/vant/es/toast/index.js");
|
|
17
|
+
const functionCall$1 = require("../../../../../node_modules/vant/es/dialog/function-call.js");
|
|
18
|
+
require("../../../../../node_modules/vant/es/dialog/index.js");
|
|
15
19
|
async function handlePageJump(node, data, fields, context) {
|
|
20
|
+
var _a, _b, _c;
|
|
16
21
|
const basic = node.basic || {};
|
|
17
|
-
const
|
|
22
|
+
const formComponent = (_a = context.components) == null ? void 0 : _a.form;
|
|
23
|
+
const getFormDataMethod = (_c = (_b = formComponent == null ? void 0 : formComponent.$) == null ? void 0 : _b.exposed) == null ? void 0 : _c.getFormData;
|
|
24
|
+
let formData = getFormDataMethod();
|
|
25
|
+
const params = parseRouteParams.parseRouteParams(basic.routeParams, { ...formData, ...data }, fields);
|
|
18
26
|
if (basic.pageId) {
|
|
19
27
|
if (basic.canNotGoBack === true) {
|
|
20
28
|
eventBus.default.emit("replaceLoadPage", { pageId: basic.pageId, params });
|
|
@@ -118,26 +126,19 @@ async function handleApiCall(node, data, fields, context, params) {
|
|
|
118
126
|
}
|
|
119
127
|
async function handleConfirm(node, data, fields, context) {
|
|
120
128
|
const basic = node.basic || {};
|
|
121
|
-
const config = {
|
|
122
|
-
messageType: basic.messageType || "warning",
|
|
123
|
-
title: basic.title || "确认操作",
|
|
124
|
-
message: basic.message || "确定要执行此操作吗?",
|
|
125
|
-
confirmText: basic.confirmText || "确定",
|
|
126
|
-
cancelText: basic.cancelText || "取消",
|
|
127
|
-
showCancel: basic.showCancel !== false,
|
|
128
|
-
confirmAction: basic.confirmAction || "continue",
|
|
129
|
-
cancelAction: basic.cancelAction || "stop"
|
|
130
|
-
};
|
|
131
129
|
try {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
130
|
+
if (basic.showCancel) {
|
|
131
|
+
await functionCall$1.showConfirmDialog({
|
|
132
|
+
title: basic.title,
|
|
133
|
+
message: basic.message
|
|
134
|
+
});
|
|
135
|
+
} else {
|
|
136
|
+
await functionCall$1.showDialog({
|
|
137
|
+
title: basic.title,
|
|
138
|
+
message: basic.message
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
if (basic.confirmAction === "stop") {
|
|
141
142
|
return {
|
|
142
143
|
success: false,
|
|
143
144
|
message: "用户确认后停止执行",
|
|
@@ -172,8 +173,20 @@ async function handleMessage(node, data, fields, context) {
|
|
|
172
173
|
};
|
|
173
174
|
}
|
|
174
175
|
if (node.basic) {
|
|
175
|
-
node.basic.messageType || "info";
|
|
176
|
-
node.basic.message || "操作成功";
|
|
176
|
+
const messageType = node.basic.messageType || "info";
|
|
177
|
+
const message = node.basic.message || "操作成功";
|
|
178
|
+
switch (messageType) {
|
|
179
|
+
case "success":
|
|
180
|
+
functionCall.showSuccessToast(message);
|
|
181
|
+
break;
|
|
182
|
+
case "error":
|
|
183
|
+
functionCall.showFailToast(message);
|
|
184
|
+
break;
|
|
185
|
+
case "info":
|
|
186
|
+
default:
|
|
187
|
+
functionCall.showToast(message);
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
177
190
|
}
|
|
178
191
|
return {
|
|
179
192
|
success: true,
|
|
@@ -47,7 +47,6 @@ const dateFormatter = (value, dateType, formatterType) => {
|
|
|
47
47
|
return dateValue.format(textFormat);
|
|
48
48
|
};
|
|
49
49
|
const textFormatter = (value, dataFormatter) => {
|
|
50
|
-
console.log("🚀 ~ textFormatter ~ dataFormatter:", dataFormatter);
|
|
51
50
|
switch (dataFormatter) {
|
|
52
51
|
case "money(yuan)":
|
|
53
52
|
case "money(wanyuan)":
|
|
@@ -74,6 +73,9 @@ const textFormatter = (value, dataFormatter) => {
|
|
|
74
73
|
}
|
|
75
74
|
};
|
|
76
75
|
const moneyFormatter = (value, dataFormatter) => {
|
|
76
|
+
if (!value) {
|
|
77
|
+
return value;
|
|
78
|
+
}
|
|
77
79
|
let moneyValue;
|
|
78
80
|
switch (dataFormatter) {
|
|
79
81
|
case "money(yuan)":
|
|
@@ -91,27 +93,6 @@ const moneyFormatter = (value, dataFormatter) => {
|
|
|
91
93
|
}
|
|
92
94
|
return XEUtils.commafy(moneyValue, { digits: 2 });
|
|
93
95
|
};
|
|
94
|
-
const textFormatter4Input = (value, dataFormatter) => {
|
|
95
|
-
if (!value) {
|
|
96
|
-
return value;
|
|
97
|
-
}
|
|
98
|
-
switch (dataFormatter) {
|
|
99
|
-
case "money(yuan)":
|
|
100
|
-
case "money(wanyuan)":
|
|
101
|
-
case "money(yi)":
|
|
102
|
-
return XEUtils.toNumberString(XEUtils.toNumber(value)).replace(
|
|
103
|
-
/\B(?=(\d{3})+(?!\d))/g,
|
|
104
|
-
","
|
|
105
|
-
);
|
|
106
|
-
case "bankCard":
|
|
107
|
-
return XEUtils.toValueString(value.replace(/\s+/g, "")).replace(
|
|
108
|
-
/\B(?=(\d{4})+(?!\d))/g,
|
|
109
|
-
" "
|
|
110
|
-
);
|
|
111
|
-
default:
|
|
112
|
-
return value;
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
96
|
const reverseTextFormatter = (value, dataFormatter) => {
|
|
116
97
|
if (!value) {
|
|
117
98
|
return value;
|
|
@@ -182,4 +163,3 @@ exports.reverseMoneyFormatter = reverseMoneyFormatter;
|
|
|
182
163
|
exports.reverseTextFormatter = reverseTextFormatter;
|
|
183
164
|
exports.selectFormatter = selectFormatter;
|
|
184
165
|
exports.textFormatter = textFormatter;
|
|
185
|
-
exports.textFormatter4Input = textFormatter4Input;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const functionCore = require("./functionCore.js");
|
|
4
|
+
const XEUtils = require("xe-utils");
|
|
4
5
|
require("vue");
|
|
5
6
|
function calculate(params) {
|
|
6
7
|
const { text, value = {}, fieldsList = [] } = params;
|
|
@@ -28,11 +29,16 @@ function calculate(params) {
|
|
|
28
29
|
const fieldItem = fieldsList.find((item) => item.fieldName == enCode);
|
|
29
30
|
if (fieldItem) {
|
|
30
31
|
switch (fieldItem.fieldType) {
|
|
31
|
-
case "
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
case "text":
|
|
33
|
+
switch (fieldItem.dataFormatter) {
|
|
34
|
+
case "money(yuan)":
|
|
35
|
+
case "money(wanyuan)":
|
|
36
|
+
case "money(yi)":
|
|
37
|
+
case "percent":
|
|
38
|
+
case "thousand":
|
|
39
|
+
case "tenThousand":
|
|
40
|
+
data = XEUtils.toNumber(data);
|
|
41
|
+
break;
|
|
36
42
|
}
|
|
37
43
|
break;
|
|
38
44
|
case "switch":
|
|
@@ -27,7 +27,7 @@ const getOptions = ({
|
|
|
27
27
|
resolve([]);
|
|
28
28
|
break;
|
|
29
29
|
}
|
|
30
|
-
const response = await ctx.$http.
|
|
30
|
+
const response = await ctx.$http.postFormMobile(
|
|
31
31
|
"/base-server/parm/sysParmDic/getDicListByKey",
|
|
32
32
|
{
|
|
33
33
|
keyName: dictionaryValue
|
|
@@ -78,33 +78,9 @@ const getOptions = ({
|
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
|
-
const getTreeOptions = ({
|
|
82
|
-
optionType,
|
|
83
|
-
dataSource,
|
|
84
|
-
dataSourceParams,
|
|
85
|
-
staticOptions,
|
|
86
|
-
optionsFieldNames
|
|
87
|
-
}) => {
|
|
88
|
-
return new Promise((resolve, reject) => {
|
|
89
|
-
switch (optionType) {
|
|
90
|
-
case "static":
|
|
91
|
-
resolve(staticOptions);
|
|
92
|
-
case "library":
|
|
93
|
-
const dataSourceRef = useDataSource(dataSource);
|
|
94
|
-
dataSourceRef == null ? void 0 : dataSourceRef.load(dataSourceParams || {}).then((res) => {
|
|
95
|
-
var _a;
|
|
96
|
-
const data = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.records) || (res == null ? void 0 : res.data) || res || [];
|
|
97
|
-
resolve(data);
|
|
98
|
-
}).catch((err) => {
|
|
99
|
-
console.error(err);
|
|
100
|
-
});
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
81
|
const getParmDicMapByKeys = async (dicKeys) => {
|
|
106
82
|
const http = index.default();
|
|
107
|
-
const res = await http.
|
|
83
|
+
const res = await http.postFormMobile(
|
|
108
84
|
`${baseUrl}/parm/sysParmDic/getDicListByKey`,
|
|
109
85
|
{
|
|
110
86
|
keyName: dicKeys
|
|
@@ -114,4 +90,3 @@ const getParmDicMapByKeys = async (dicKeys) => {
|
|
|
114
90
|
};
|
|
115
91
|
exports.getOptions = getOptions;
|
|
116
92
|
exports.getParmDicMapByKeys = getParmDicMapByKeys;
|
|
117
|
-
exports.getTreeOptions = getTreeOptions;
|
|
@@ -41,6 +41,7 @@ class PageHistory {
|
|
|
41
41
|
if (this.history.length > 0 && this.history[this.history.length - 1].id == page.id) {
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
+
this.setWmpTitle(page.name);
|
|
44
45
|
this.history.push({
|
|
45
46
|
id: page.id,
|
|
46
47
|
name: page.name || "",
|
|
@@ -61,6 +62,7 @@ class PageHistory {
|
|
|
61
62
|
this.push(page);
|
|
62
63
|
return;
|
|
63
64
|
}
|
|
65
|
+
this.setWmpTitle(page.name);
|
|
64
66
|
this.history[this.history.length - 1] = {
|
|
65
67
|
id: page.id,
|
|
66
68
|
name: page.name || "",
|
|
@@ -83,6 +85,7 @@ class PageHistory {
|
|
|
83
85
|
const pageId = prevPage ? prevPage.id : null;
|
|
84
86
|
const params = prevPage ? prevPage.params : null;
|
|
85
87
|
if (pageId) {
|
|
88
|
+
this.setWmpTitle(prevPage.name);
|
|
86
89
|
eventBus.default.emit("loadPage", { pageId, params });
|
|
87
90
|
}
|
|
88
91
|
}
|
|
@@ -117,6 +120,19 @@ class PageHistory {
|
|
|
117
120
|
this.history = [];
|
|
118
121
|
this.saveHistory();
|
|
119
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* 设置微信小程序标题
|
|
125
|
+
*/
|
|
126
|
+
setWmpTitle(title) {
|
|
127
|
+
if (window.wx && wx.miniProgram) {
|
|
128
|
+
wx.miniProgram.postMessage({
|
|
129
|
+
data: {
|
|
130
|
+
type: "setTitle",
|
|
131
|
+
title
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
120
136
|
}
|
|
121
137
|
const pageHistory = new PageHistory();
|
|
122
138
|
exports.default = pageHistory;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const parseFilterConfig = require("./parseFilterConfig.js");
|
|
4
|
+
const VALIDATION_RULES = {
|
|
5
|
+
// 身份证
|
|
6
|
+
idCard: {
|
|
7
|
+
pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
|
|
8
|
+
message: "请输入正确的身份证号码"
|
|
9
|
+
},
|
|
10
|
+
// 统一社会信用代码
|
|
11
|
+
creditCode: {
|
|
12
|
+
pattern: /^[0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}$/,
|
|
13
|
+
message: "请输入正确的统一社会信用代码"
|
|
14
|
+
},
|
|
15
|
+
// 邮编
|
|
16
|
+
zipCode: {
|
|
17
|
+
pattern: /^[1-9]\d{5}$/,
|
|
18
|
+
message: "请输入正确的邮政编码"
|
|
19
|
+
},
|
|
20
|
+
// 传真
|
|
21
|
+
fax: {
|
|
22
|
+
pattern: /^\d{3,4}-?\d{7,8}$/,
|
|
23
|
+
message: "请输入正确的传真号码"
|
|
24
|
+
},
|
|
25
|
+
// 银行卡号
|
|
26
|
+
bankCard: {
|
|
27
|
+
pattern: /^[1-9]\d{15,18}$/,
|
|
28
|
+
message: "请输入正确的银行卡号"
|
|
29
|
+
},
|
|
30
|
+
// 邮箱
|
|
31
|
+
email: {
|
|
32
|
+
pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
|
|
33
|
+
message: "请输入正确的邮箱地址"
|
|
34
|
+
},
|
|
35
|
+
// 手机
|
|
36
|
+
mobile: {
|
|
37
|
+
pattern: /^1[3-9]\d{9}$/,
|
|
38
|
+
message: "请输入正确的手机号码"
|
|
39
|
+
},
|
|
40
|
+
// 座机
|
|
41
|
+
phone: {
|
|
42
|
+
pattern: /^0\d{2,3}-?\d{7,8}$/,
|
|
43
|
+
message: "请输入正确的座机号码"
|
|
44
|
+
},
|
|
45
|
+
// 手机+座机
|
|
46
|
+
mobilePhone: {
|
|
47
|
+
pattern: /^(1[3-9]\d{9})|(0\d{2,3}-?\d{7,8})$/,
|
|
48
|
+
message: "请输入正确的联系电话"
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
function generateFieldRules(component, formData, fields) {
|
|
52
|
+
const rules = [];
|
|
53
|
+
if (!component.fieldName) {
|
|
54
|
+
return rules;
|
|
55
|
+
}
|
|
56
|
+
if (component.required) {
|
|
57
|
+
rules.push({
|
|
58
|
+
required: true,
|
|
59
|
+
message: component.requiredMessage || `请录入${component.label}`,
|
|
60
|
+
trigger: "blur"
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (component.validationType && component.validationType !== "none") {
|
|
64
|
+
if (component.validationType === "regex" && component.validationPattern) {
|
|
65
|
+
try {
|
|
66
|
+
const validator = (_rule, _value, callback) => {
|
|
67
|
+
try {
|
|
68
|
+
const isMatch = parseFilterConfig.checkFilterMatch(component.validationPattern, formData.value, fields);
|
|
69
|
+
if (!isMatch) {
|
|
70
|
+
callback(new Error(component.validationMessage || "校验失败"));
|
|
71
|
+
} else {
|
|
72
|
+
callback();
|
|
73
|
+
}
|
|
74
|
+
} catch (error) {
|
|
75
|
+
console.error("Validation function error:", error);
|
|
76
|
+
callback(new Error(component.validationMessage || "校验函数执行出错"));
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
rules.push({
|
|
80
|
+
validator,
|
|
81
|
+
trigger: "change"
|
|
82
|
+
});
|
|
83
|
+
} catch (e) {
|
|
84
|
+
console.error("Invalid validation pattern:", component.validationPattern, e);
|
|
85
|
+
}
|
|
86
|
+
} else if (component.validationType === "custom" && component.customValidator) {
|
|
87
|
+
try {
|
|
88
|
+
const validator = createCustomValidator(component.customValidator);
|
|
89
|
+
if (validator) {
|
|
90
|
+
rules.push({
|
|
91
|
+
validator,
|
|
92
|
+
trigger: "blur"
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
} catch (e) {
|
|
96
|
+
console.error("Invalid custom validator:", e);
|
|
97
|
+
}
|
|
98
|
+
} else if (VALIDATION_RULES[component.validationType]) {
|
|
99
|
+
const rule = VALIDATION_RULES[component.validationType];
|
|
100
|
+
rules.push({
|
|
101
|
+
pattern: rule.pattern,
|
|
102
|
+
message: component.validationMessage || rule.message,
|
|
103
|
+
trigger: "blur"
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return rules;
|
|
108
|
+
}
|
|
109
|
+
function createCustomValidator(validatorStr) {
|
|
110
|
+
if (!validatorStr || typeof validatorStr !== "string") {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
const validator = new Function("return " + validatorStr)();
|
|
115
|
+
if (typeof validator === "function") {
|
|
116
|
+
return (rule, value, callback) => {
|
|
117
|
+
try {
|
|
118
|
+
validator(rule, value, callback);
|
|
119
|
+
} catch (error) {
|
|
120
|
+
callback(new Error("校验函数执行出错: " + error.message));
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
} catch (e) {
|
|
125
|
+
console.error("Failed to create validator from string:", e);
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
exports.generateFieldRules = generateFieldRules;
|
|
@@ -197,7 +197,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
197
197
|
if (showThousandsSeparator.value) {
|
|
198
198
|
value = formatNumberWithComma(value);
|
|
199
199
|
}
|
|
200
|
-
return value;
|
|
200
|
+
return (value == null ? void 0 : value.toString()) || "";
|
|
201
201
|
};
|
|
202
202
|
const showThousandsSeparator = Vue.computed(() => {
|
|
203
203
|
return props.format == "yuan" || props.format == "wan" || props.format == "million";
|
|
@@ -451,6 +451,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
451
451
|
disabled: __props.disabled,
|
|
452
452
|
readonly: __props.readonly,
|
|
453
453
|
formatter,
|
|
454
|
+
maxlength: 15,
|
|
454
455
|
parser,
|
|
455
456
|
onBlur: handleBlur,
|
|
456
457
|
onInput: handleInput
|
|
@@ -506,5 +507,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
506
507
|
};
|
|
507
508
|
}
|
|
508
509
|
});
|
|
509
|
-
const _Number = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-
|
|
510
|
+
const _Number = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-93ac5b02"]]);
|
|
510
511
|
exports.default = _Number;
|
|
@@ -40,7 +40,8 @@ const _hoisted_2 = {
|
|
|
40
40
|
key: 0,
|
|
41
41
|
class: "prefix-content"
|
|
42
42
|
};
|
|
43
|
-
const _hoisted_3 =
|
|
43
|
+
const _hoisted_3 = ["title"];
|
|
44
|
+
const _hoisted_4 = {
|
|
44
45
|
key: 3,
|
|
45
46
|
class: "suffix-content"
|
|
46
47
|
};
|
|
@@ -273,7 +274,7 @@ const _sfc_main = {
|
|
|
273
274
|
resizable: false,
|
|
274
275
|
"show-header-overflow": "",
|
|
275
276
|
"show-footer-overflow": "",
|
|
276
|
-
"show-overflow":
|
|
277
|
+
"show-overflow": false,
|
|
277
278
|
"header-class-name": field.sortRule == "server" ? "serverSort" : ""
|
|
278
279
|
}, {
|
|
279
280
|
default: Vue.withCtx(({ row }) => [
|
|
@@ -284,18 +285,21 @@ const _sfc_main = {
|
|
|
284
285
|
field.prefix ? (Vue.openBlock(), Vue.createElementBlock("span", _hoisted_2, Vue.toDisplayString(field.prefix), 1)) : Vue.createCommentVNode("", true),
|
|
285
286
|
field.isLink ? (Vue.openBlock(), Vue.createBlock(_component_el_link, {
|
|
286
287
|
key: 1,
|
|
288
|
+
class: "cell-link",
|
|
287
289
|
type: "primary",
|
|
288
290
|
underline: "never",
|
|
291
|
+
title: __props.formatCellValue(row, field),
|
|
289
292
|
onClick: ($event) => handleButtonClick(row, field, field.linkConfig)
|
|
290
293
|
}, {
|
|
291
294
|
default: Vue.withCtx(() => [
|
|
292
295
|
Vue.createTextVNode(Vue.toDisplayString(__props.formatCellValue(row, field)), 1)
|
|
293
296
|
]),
|
|
294
297
|
_: 2
|
|
295
|
-
}, 1032, ["onClick"])) : (Vue.openBlock(), Vue.createElementBlock(
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
298
|
+
}, 1032, ["title", "onClick"])) : (Vue.openBlock(), Vue.createElementBlock("span", {
|
|
299
|
+
key: 2,
|
|
300
|
+
title: __props.formatCellValue(row, field)
|
|
301
|
+
}, Vue.toDisplayString(__props.formatCellValue(row, field)), 9, _hoisted_3)),
|
|
302
|
+
field.suffix ? (Vue.openBlock(), Vue.createElementBlock("span", _hoisted_4, Vue.toDisplayString(field.suffix), 1)) : Vue.createCommentVNode("", true),
|
|
299
303
|
field.canCopy ? (Vue.openBlock(), Vue.createBlock(_component_el_icon, {
|
|
300
304
|
key: 4,
|
|
301
305
|
class: "copy-icon",
|
|
@@ -309,7 +313,7 @@ const _sfc_main = {
|
|
|
309
313
|
], true)
|
|
310
314
|
]),
|
|
311
315
|
_: 2
|
|
312
|
-
}, 1032, ["field", "title", "width", "min-width", "fixed", "align", "header-align", "sortable", "
|
|
316
|
+
}, 1032, ["field", "title", "width", "min-width", "fixed", "align", "header-align", "sortable", "header-class-name"]);
|
|
313
317
|
}), 128)),
|
|
314
318
|
!__props.readonly && shouldShowOptColumn.value ? (Vue.openBlock(), Vue.createBlock(Vue.unref(vxeTable.VxeColumn), {
|
|
315
319
|
key: 3,
|
|
@@ -341,5 +345,5 @@ const _sfc_main = {
|
|
|
341
345
|
};
|
|
342
346
|
}
|
|
343
347
|
};
|
|
344
|
-
const TableColumn = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-
|
|
348
|
+
const TableColumn = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-7b218935"]]);
|
|
345
349
|
exports.default = TableColumn;
|