ns-base-module 1.0.12 → 1.0.14
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/ChooseModal/index.js +1 -1
- package/dist/Entry/components/TreeSelect.d.ts +4 -5
- package/dist/Entry/components/TreeSelect.d.ts.map +1 -1
- package/dist/Entry/components/TreeSelect.js +13 -5
- package/dist/Icon/index.d.ts.map +1 -1
- package/dist/Icon/index.js +2 -3
- package/dist/IconTools/index.d.ts.map +1 -1
- package/dist/IconTools/index.js +1 -1
- package/dist/SubtotalsModal/addSubtotals.d.ts.map +1 -1
- package/dist/SubtotalsModal/addSubtotals.js +1 -1
- package/dist/SubtotalsModal/dndQuota.d.ts +4 -1
- package/dist/SubtotalsModal/dndQuota.d.ts.map +1 -1
- package/dist/SubtotalsModal/dndQuota.js +158 -23
- package/dist/SubtotalsModal/index.d.ts +1 -0
- package/dist/SubtotalsModal/index.d.ts.map +1 -1
- package/dist/SubtotalsModal/index.js +15 -3
- package/dist/SubtotalsModal/viewSubtotals.d.ts +1 -0
- package/dist/SubtotalsModal/viewSubtotals.d.ts.map +1 -1
- package/dist/SubtotalsModal/viewSubtotals.js +1 -0
- package/dist/TableHeaderConfigPopover/index.d.ts +2 -0
- package/dist/TableHeaderConfigPopover/index.d.ts.map +1 -1
- package/dist/TableHeaderConfigPopover/index.js +230 -111
- package/dist/TableHeaderConfigPopover/updateColumns.d.ts +10 -0
- package/dist/TableHeaderConfigPopover/updateColumns.d.ts.map +1 -0
- package/dist/TableHeaderConfigPopover/updateColumns.js +26 -0
- package/dist/TableHeaderConfigPopover/utils.d.ts +13 -0
- package/dist/TableHeaderConfigPopover/utils.d.ts.map +1 -1
- package/dist/TableHeaderConfigPopover/utils.js +188 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/umd/ns-base-module.min.css +1 -1
- package/dist/umd/ns-base-module.min.js +1 -1
- package/dist/utils/language.d.ts +28 -1
- package/dist/utils/language.d.ts.map +1 -1
- package/dist/utils/language.js +29 -2
- package/dist/utils/utils.d.ts +6 -7
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +104 -103
- package/package.json +1 -1
- package/style/components/SubtotalsModal.scss +41 -12
- package/types/types.d.ts +1 -0
package/dist/utils/language.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare const defaultLang: {
|
|
|
21
21
|
"list.column.sort": string;
|
|
22
22
|
"list.expandableAll": string;
|
|
23
23
|
"search.title": string;
|
|
24
|
+
"classFilter.title": string;
|
|
24
25
|
"message.warn.select.least": string;
|
|
25
26
|
"message.warn.select.not": string;
|
|
26
27
|
"message.warn.select.over": string;
|
|
@@ -33,14 +34,21 @@ export declare const defaultLang: {
|
|
|
33
34
|
"message.error.network.desc": string;
|
|
34
35
|
"message.success.request": string;
|
|
35
36
|
"message.success.login": string;
|
|
37
|
+
"message.success.set": string;
|
|
36
38
|
"message.preview.tip": string;
|
|
37
39
|
"login.label.username": string;
|
|
38
40
|
"login.label.client": string;
|
|
39
41
|
"login.label.password": string;
|
|
40
42
|
"login.label.code": string;
|
|
41
|
-
"
|
|
43
|
+
"login.label.phoneEmail": string;
|
|
44
|
+
"login.label.phoneEmail.tip": string;
|
|
42
45
|
"button.view": string;
|
|
46
|
+
"button.save": string;
|
|
47
|
+
"button.edit": string;
|
|
48
|
+
"button.set.default": string;
|
|
49
|
+
"button.set.cancelDefault": string;
|
|
43
50
|
"button.ok": string;
|
|
51
|
+
"button.knows": string;
|
|
44
52
|
"button.cancel": string;
|
|
45
53
|
"button.back": string;
|
|
46
54
|
"button.delete": string;
|
|
@@ -99,6 +107,13 @@ export declare const defaultLang: {
|
|
|
99
107
|
"setting.info.newPsw": string;
|
|
100
108
|
"setting.info.surePsw": string;
|
|
101
109
|
"setting.info.isOpenNewTab": string;
|
|
110
|
+
"setting.info.tab.shutOther": string;
|
|
111
|
+
"setting.info.tab.shutCurent": string;
|
|
112
|
+
"setting.info.tab.refresh": string;
|
|
113
|
+
"setting.info.tab.default": string;
|
|
114
|
+
"setting.info.tab.newTab": string;
|
|
115
|
+
"setting.info.tab.newWin": string;
|
|
116
|
+
"setting.info.tabCacheLimit": string;
|
|
102
117
|
"setting.info.isOpenQueryCache": string;
|
|
103
118
|
"setting.info.shutMenu": string;
|
|
104
119
|
"setting.info.style": string;
|
|
@@ -143,6 +158,7 @@ export declare const defaultLang: {
|
|
|
143
158
|
"prompt.copyCol": string;
|
|
144
159
|
"prompt.asc": string;
|
|
145
160
|
"prompt.desc": string;
|
|
161
|
+
"prompt.text.default": string;
|
|
146
162
|
"prompt.nameTemplate": string;
|
|
147
163
|
"prompt.placeholderTemplate": string;
|
|
148
164
|
"prompt.shareTemplate": string;
|
|
@@ -152,6 +168,12 @@ export declare const defaultLang: {
|
|
|
152
168
|
"prompt.summaryTemplate": string;
|
|
153
169
|
"prompt.publicTemplate": string;
|
|
154
170
|
"prompt.copyTemplate": string;
|
|
171
|
+
"prompt.template.list": string;
|
|
172
|
+
"prompt.list": string;
|
|
173
|
+
"prompt.template.cross": string;
|
|
174
|
+
"prompt.sum.row": string;
|
|
175
|
+
"prompt.sum.col.left": string;
|
|
176
|
+
"prompt.sum.col.right": string;
|
|
155
177
|
"prompt.feedback": string;
|
|
156
178
|
"prompt.information": string;
|
|
157
179
|
"prompt.downloadCenter": string;
|
|
@@ -180,6 +202,7 @@ export declare const defaultLang: {
|
|
|
180
202
|
"brick.config.modal.form.searchShowType.modal": string;
|
|
181
203
|
"brick.config.modal.form.searchShowType.panel": string;
|
|
182
204
|
"brick.config.modal.form.searchShowType.slide": string;
|
|
205
|
+
"brick.config.modal.form.searchShowType.slideLeft": string;
|
|
183
206
|
"brick.config.modal.form.firstLoad": string;
|
|
184
207
|
"cashier.page.title": string;
|
|
185
208
|
"cashier.tab.title": string;
|
|
@@ -231,6 +254,10 @@ export declare const defaultLang: {
|
|
|
231
254
|
"pay.svc.info.inputCode": string;
|
|
232
255
|
"pay.svc.info.inputCardId": string;
|
|
233
256
|
"pay.message.payining": string;
|
|
257
|
+
"upload.wran": string;
|
|
258
|
+
"upload.error": string;
|
|
259
|
+
"upload.error.sign": string;
|
|
260
|
+
"upload.loading": string;
|
|
234
261
|
};
|
|
235
262
|
export interface InitLangProps {
|
|
236
263
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"language.d.ts","sourceRoot":"","sources":["language.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"language.d.ts","sourceRoot":"","sources":["language.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqQvB,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAGD,eAAO,MAAM,gBAAgB,mBAAoB,MAAM,SAAS,GAAG,WAIlE,CAAC;AAEF,eAAO,MAAM,QAAQ,+BAAgC,aAAa,WAMjE,CAAC"}
|
package/dist/utils/language.js
CHANGED
|
@@ -21,6 +21,7 @@ export var defaultLang = {
|
|
|
21
21
|
"list.column.sort": "排序",
|
|
22
22
|
"list.expandableAll": "展开/收起所有行",
|
|
23
23
|
"search.title": "查询面板",
|
|
24
|
+
"classFilter.title": "分类过滤",
|
|
24
25
|
"message.warn.select.least": "请至少勾选一条记录",
|
|
25
26
|
"message.warn.select.not": "请勾选一条记录",
|
|
26
27
|
"message.warn.select.over": "只能选择一条记录",
|
|
@@ -33,14 +34,21 @@ export var defaultLang = {
|
|
|
33
34
|
"message.error.network.desc": "您的网络发生异常,无法连接服务器",
|
|
34
35
|
"message.success.request": "请求成功",
|
|
35
36
|
"message.success.login": "登录成功",
|
|
37
|
+
"message.success.set": "设置成功",
|
|
36
38
|
"message.preview.tip": "预览按钮无实际触发效果",
|
|
37
39
|
"login.label.username": "用户名",
|
|
38
40
|
"login.label.client": "客户端",
|
|
39
41
|
"login.label.password": "密码",
|
|
40
42
|
"login.label.code": "验证码",
|
|
41
|
-
"
|
|
43
|
+
"login.label.phoneEmail": "手机号或邮箱",
|
|
44
|
+
"login.label.phoneEmail.tip": "请输入手机号或邮箱",
|
|
42
45
|
"button.view": "预览",
|
|
46
|
+
"button.save": "保存",
|
|
47
|
+
"button.edit": "编辑",
|
|
48
|
+
"button.set.default": "设置默认",
|
|
49
|
+
"button.set.cancelDefault": "取消默认",
|
|
43
50
|
"button.ok": "确定",
|
|
51
|
+
"button.knows": "知道了",
|
|
44
52
|
"button.cancel": "取消",
|
|
45
53
|
"button.back": "返回",
|
|
46
54
|
"button.delete": "删除",
|
|
@@ -99,6 +107,13 @@ export var defaultLang = {
|
|
|
99
107
|
"setting.info.newPsw": "新密码",
|
|
100
108
|
"setting.info.surePsw": "确认新密码",
|
|
101
109
|
"setting.info.isOpenNewTab": "在新浏览器标签页打开菜单",
|
|
110
|
+
"setting.info.tab.shutOther": "关闭其他标签",
|
|
111
|
+
"setting.info.tab.shutCurent": "关闭当前标签",
|
|
112
|
+
"setting.info.tab.refresh": "刷新当前页面",
|
|
113
|
+
"setting.info.tab.default": "默认",
|
|
114
|
+
"setting.info.tab.newTab": "新标签页",
|
|
115
|
+
"setting.info.tab.newWin": "新窗口",
|
|
116
|
+
"setting.info.tabCacheLimit": "新标签页缓存阀值",
|
|
102
117
|
"setting.info.isOpenQueryCache": "是否开启页面查询缓存",
|
|
103
118
|
"setting.info.shutMenu": "默认收起菜单",
|
|
104
119
|
"setting.info.style": "页面风格",
|
|
@@ -143,6 +158,7 @@ export var defaultLang = {
|
|
|
143
158
|
"prompt.copyCol": "复制",
|
|
144
159
|
"prompt.asc": "升序",
|
|
145
160
|
"prompt.desc": "降序",
|
|
161
|
+
"prompt.text.default": "默认",
|
|
146
162
|
"prompt.nameTemplate": "模板名称",
|
|
147
163
|
"prompt.placeholderTemplate": "请输入模板名称",
|
|
148
164
|
"prompt.shareTemplate": "分享给其他同事",
|
|
@@ -152,6 +168,12 @@ export var defaultLang = {
|
|
|
152
168
|
"prompt.summaryTemplate": "分类汇总模板",
|
|
153
169
|
"prompt.publicTemplate": "公共模板",
|
|
154
170
|
"prompt.copyTemplate": "复制成个人模板",
|
|
171
|
+
"prompt.template.list": "列表",
|
|
172
|
+
"prompt.list": "列表",
|
|
173
|
+
"prompt.template.cross": "交叉表",
|
|
174
|
+
"prompt.sum.row": "显示行总计",
|
|
175
|
+
"prompt.sum.col.left": "列总计显示左",
|
|
176
|
+
"prompt.sum.col.right": "列总计显示右",
|
|
155
177
|
"prompt.feedback": "反馈中心",
|
|
156
178
|
"prompt.information": "信息",
|
|
157
179
|
"prompt.downloadCenter": "下载中心",
|
|
@@ -180,6 +202,7 @@ export var defaultLang = {
|
|
|
180
202
|
"brick.config.modal.form.searchShowType.modal": "弹窗",
|
|
181
203
|
"brick.config.modal.form.searchShowType.panel": "面板",
|
|
182
204
|
"brick.config.modal.form.searchShowType.slide": "右滑",
|
|
205
|
+
"brick.config.modal.form.searchShowType.slideLeft": "左滑",
|
|
183
206
|
"brick.config.modal.form.firstLoad": "首次不加载",
|
|
184
207
|
"cashier.page.title": "收银",
|
|
185
208
|
"cashier.tab.title": "新建订单",
|
|
@@ -230,7 +253,11 @@ export var defaultLang = {
|
|
|
230
253
|
"pay.svc.button.sendSMS": "获取验证码",
|
|
231
254
|
"pay.svc.info.inputCode": "请输入验证码",
|
|
232
255
|
"pay.svc.info.inputCardId": "请输入卡号",
|
|
233
|
-
"pay.message.payining": "正在支付中...."
|
|
256
|
+
"pay.message.payining": "正在支付中....",
|
|
257
|
+
"upload.wran": "最大限制",
|
|
258
|
+
"upload.error": "上传失败",
|
|
259
|
+
"upload.error.sign": "文件名不能存在特殊符号",
|
|
260
|
+
"upload.loading": "正在上传..."
|
|
234
261
|
};
|
|
235
262
|
//
|
|
236
263
|
export var parsePlaceholder = function parsePlaceholder(placeholderStr, data) {
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { ButtonsType } from
|
|
2
|
-
import type { EntryType } from
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type { rulesFn } from
|
|
1
|
+
import type { ButtonsType } from "@/components/v2/ButtonGroup";
|
|
2
|
+
import type { EntryType } from "@/components/v2/Form";
|
|
3
|
+
import type { AppButtonsType } from "@/components/v2/Mobile2/ButtonGroup";
|
|
4
|
+
import type { EntryType as AppEntryType } from "@/components/v2/Mobile2/Entry";
|
|
5
|
+
import type { rulesFn } from "@/utils/type";
|
|
6
|
+
import { TagConditionEnum } from "./enum";
|
|
6
7
|
export declare const isUrl: (path: string) => boolean;
|
|
7
8
|
export declare const regMap: rulesFn;
|
|
8
9
|
export declare const isAntDesignPro: () => boolean;
|
|
9
10
|
export declare const isAntDesignProOrDev: () => boolean;
|
|
10
|
-
export declare const getPageQuery: () => import("querystring").ParsedUrlQuery;
|
|
11
11
|
export declare const pathAddIds: (url: string, dataSource: Record<string, any>[], hasPageTurning: boolean) => string;
|
|
12
12
|
export declare type dynamicPathParamsType = ButtonsType | AppButtonsType | {
|
|
13
13
|
config: {
|
|
@@ -39,7 +39,6 @@ export declare const matchCondition: (condition: TagConditionEnum, value: string
|
|
|
39
39
|
*/
|
|
40
40
|
export declare const getMuilObjectValue: (keysStr: string, obj: Record<string, any>) => any;
|
|
41
41
|
export declare const handlePercentage: (width: string | undefined) => string | number | undefined;
|
|
42
|
-
export declare const buttonCount: (buttonConfig: any[], record: any[]) => any[];
|
|
43
42
|
export declare function flattenArrayObjects(arr: any[], children?: string): any[];
|
|
44
43
|
export interface IColorObj {
|
|
45
44
|
r: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"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"}
|
package/dist/utils/utils.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
import { parse } from
|
|
2
|
+
// import { parse } from "querystring";
|
|
3
|
+
|
|
3
4
|
import { initLang } from "./language";
|
|
4
|
-
import Cookies from
|
|
5
|
+
import Cookies from "js-cookie";
|
|
6
|
+
import { get } from "lodash";
|
|
5
7
|
import { TagConditionEnum } from "./enum";
|
|
6
|
-
|
|
7
|
-
var interpret = require('aexpr');
|
|
8
|
+
// const interpret = require("aexpr");
|
|
8
9
|
|
|
9
10
|
// /* eslint no-useless-escape:0 import/prefer-default-export:0 */
|
|
10
11
|
var reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
|
|
@@ -13,36 +14,35 @@ export var isUrl = function isUrl(path) {
|
|
|
13
14
|
};
|
|
14
15
|
export var regMap = {
|
|
15
16
|
phone: {
|
|
16
|
-
message:
|
|
17
|
+
message: "请输入正确手机号",
|
|
17
18
|
pattern: new RegExp(/^1\d{10}$/)
|
|
18
19
|
},
|
|
19
20
|
email: {
|
|
20
|
-
message:
|
|
21
|
+
message: "请输入正确邮箱",
|
|
21
22
|
pattern: new RegExp(/^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/)
|
|
22
23
|
},
|
|
23
24
|
card: {
|
|
24
|
-
message:
|
|
25
|
+
message: "请输入正确身份证号",
|
|
25
26
|
pattern: new RegExp(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/)
|
|
26
27
|
}
|
|
27
28
|
};
|
|
28
29
|
export var isAntDesignPro = function isAntDesignPro() {
|
|
29
|
-
if (ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION ===
|
|
30
|
+
if (ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === "site") {
|
|
30
31
|
return true;
|
|
31
32
|
}
|
|
32
|
-
return window.location.hostname ===
|
|
33
|
+
return window.location.hostname === "preview.pro.ant.design";
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
// 给官方演示站点用,用于关闭真实开发环境不需要使用的特性
|
|
36
37
|
export var isAntDesignProOrDev = function isAntDesignProOrDev() {
|
|
37
38
|
var NODE_ENV = process.env.NODE_ENV;
|
|
38
|
-
if (NODE_ENV ===
|
|
39
|
+
if (NODE_ENV === "development") {
|
|
39
40
|
return true;
|
|
40
41
|
}
|
|
41
42
|
return isAntDesignPro();
|
|
42
43
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
44
|
+
|
|
45
|
+
// export const getPageQuery = () => parse(window.location.href.split("?")[1]);
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* @description: 替换字符串中${} 占位
|
|
@@ -58,13 +58,13 @@ var replaceCode = function replaceCode(path, data) {
|
|
|
58
58
|
// 路由参数加ids
|
|
59
59
|
export var pathAddIds = function pathAddIds(url, dataSource, hasPageTurning) {
|
|
60
60
|
if (!hasPageTurning) return url;
|
|
61
|
-
var __ids =
|
|
61
|
+
var __ids = "";
|
|
62
62
|
__ids = dataSource.map(function (item) {
|
|
63
63
|
return item.id;
|
|
64
64
|
});
|
|
65
65
|
__ids = __ids.join();
|
|
66
66
|
if (!__ids) return url;
|
|
67
|
-
var _path = url.includes(
|
|
67
|
+
var _path = url.includes("?") ? "".concat(url, "&__ids=").concat(__ids) : "".concat(url, "?__ids=").concat(__ids);
|
|
68
68
|
return _path;
|
|
69
69
|
};
|
|
70
70
|
/**
|
|
@@ -76,19 +76,19 @@ export var pathAddIds = function pathAddIds(url, dataSource, hasPageTurning) {
|
|
|
76
76
|
export var dynamicPath = function dynamicPath(detail, record, dataSource) {
|
|
77
77
|
var _detail$config, _detail$config2, _detail$config3;
|
|
78
78
|
// console.log(detail, record);
|
|
79
|
-
var pathParam = ((detail === null || detail === void 0 || (_detail$config = detail.config) === null || _detail$config === void 0 ? void 0 : _detail$config.path) ||
|
|
79
|
+
var pathParam = ((detail === null || detail === void 0 || (_detail$config = detail.config) === null || _detail$config === void 0 ? void 0 : _detail$config.path) || "").split("?");
|
|
80
80
|
if (pathParam.length > 2) return detail === null || detail === void 0 || (_detail$config2 = detail.config) === null || _detail$config2 === void 0 ? void 0 : _detail$config2.path; // 有两个?号 跳转不是我们自己的域名
|
|
81
81
|
|
|
82
|
-
var path = get(pathParam,
|
|
83
|
-
var keys = path.split(
|
|
82
|
+
var path = get(pathParam, "[0]", "");
|
|
83
|
+
var keys = path.split(":");
|
|
84
84
|
keys.splice(0, 1);
|
|
85
85
|
keys = keys.map(function (key) {
|
|
86
|
-
return key.indexOf(
|
|
86
|
+
return key.indexOf("/") == -1 ? key : key.split("/")[0];
|
|
87
87
|
});
|
|
88
88
|
keys.forEach(function (key) {
|
|
89
89
|
if (key && !((record === null || record === void 0 ? void 0 : record[key]) === null || (record === null || record === void 0 ? void 0 : record[key]) === undefined)) path = path.replace(":".concat(key), record === null || record === void 0 ? void 0 : record[key]);
|
|
90
90
|
});
|
|
91
|
-
var url = get(pathParam,
|
|
91
|
+
var url = get(pathParam, "[1]") ? path + "?" + get(pathParam, "[1]") : path;
|
|
92
92
|
url = replaceCode(url, record);
|
|
93
93
|
|
|
94
94
|
// 上下条 拼接ids
|
|
@@ -101,31 +101,31 @@ export var dynamicPath = function dynamicPath(detail, record, dataSource) {
|
|
|
101
101
|
export var dynamicRedirect = function dynamicRedirect(detail, record) {
|
|
102
102
|
var _detail$config5;
|
|
103
103
|
console.log(detail, record);
|
|
104
|
-
var pathParam = ((detail === null || detail === void 0 || (_detail$config5 = detail.config) === null || _detail$config5 === void 0 ? void 0 : _detail$config5.path) ||
|
|
105
|
-
var path = get(pathParam,
|
|
106
|
-
var keys = path.split(
|
|
104
|
+
var pathParam = ((detail === null || detail === void 0 || (_detail$config5 = detail.config) === null || _detail$config5 === void 0 ? void 0 : _detail$config5.path) || "").split("?");
|
|
105
|
+
var path = get(pathParam, "[0]", "");
|
|
106
|
+
var keys = path.split(":");
|
|
107
107
|
keys.splice(0, 1);
|
|
108
108
|
keys = keys.map(function (key) {
|
|
109
|
-
return key.indexOf(
|
|
109
|
+
return key.indexOf("/") == -1 ? key : key.split("/")[0];
|
|
110
110
|
});
|
|
111
111
|
keys.forEach(function (key) {
|
|
112
112
|
if (key && !((record === null || record === void 0 ? void 0 : record[key]) === null || (record === null || record === void 0 ? void 0 : record[key]) === undefined)) path = path.replace(":".concat(key), record === null || record === void 0 ? void 0 : record[key]);
|
|
113
113
|
});
|
|
114
|
-
var url = get(pathParam,
|
|
114
|
+
var url = get(pathParam, "[1]", null) ? path + "?" + get(pathParam, "[1]", null) : path;
|
|
115
115
|
return url;
|
|
116
116
|
};
|
|
117
117
|
export var formatUnit = function formatUnit(value, unit) {
|
|
118
118
|
if (!unit) return value;
|
|
119
119
|
switch (unit) {
|
|
120
|
-
case
|
|
120
|
+
case "万":
|
|
121
121
|
return value / 10000;
|
|
122
|
-
case
|
|
122
|
+
case "亿":
|
|
123
123
|
return value / 100000000;
|
|
124
|
-
case
|
|
124
|
+
case "K":
|
|
125
125
|
return value / 1000;
|
|
126
|
-
case
|
|
126
|
+
case "M":
|
|
127
127
|
return value / 1000000;
|
|
128
|
-
case
|
|
128
|
+
case "G":
|
|
129
129
|
return value / 1000000000;
|
|
130
130
|
}
|
|
131
131
|
};
|
|
@@ -133,58 +133,57 @@ export var formatUnit = function formatUnit(value, unit) {
|
|
|
133
133
|
// 数据格式化
|
|
134
134
|
export var formatData = function formatData(value, format) {
|
|
135
135
|
// console.log(value, format);
|
|
136
|
-
if (value === null || value === undefined || value ===
|
|
136
|
+
if (value === null || value === undefined || value === "") return value;
|
|
137
137
|
switch (format === null || format === void 0 ? void 0 : format.type) {
|
|
138
|
-
case
|
|
139
|
-
var preValue = (Number(value) * 100).toFixed((format === null || format === void 0 ? void 0 : format.decimalPlaces) || 0) +
|
|
140
|
-
return format.isShowZero ? preValue : Number(value) !== 0 ? preValue :
|
|
141
|
-
case
|
|
138
|
+
case "percentage":
|
|
139
|
+
var preValue = (Number(value) * 100).toFixed((format === null || format === void 0 ? void 0 : format.decimalPlaces) || 0) + "%";
|
|
140
|
+
return format.isShowZero ? preValue : Number(value) !== 0 ? preValue : "";
|
|
141
|
+
case "scientific":
|
|
142
142
|
var sciValue = Number(value).toFixed((format === null || format === void 0 ? void 0 : format.decimalPlaces) || 0);
|
|
143
|
-
return format.isShowZero ? sciValue : Number(value) !== 0 ? sciValue :
|
|
144
|
-
case
|
|
143
|
+
return format.isShowZero ? sciValue : Number(value) !== 0 ? sciValue : "";
|
|
144
|
+
case "number":
|
|
145
145
|
// debugger;
|
|
146
146
|
// console.log(typeof Number(formatUnit(value, format.unit)).toFixed(format.decimalPlaces));
|
|
147
|
-
var numValue = (format !== null && format !== void 0 && format.isThousands ? format !== null && format !== void 0 && format.decimalPlaces ? Number(Number(formatUnit(value, format.unit)).toFixed(format.decimalPlaces)).toLocaleString() : Number(formatUnit(value, format.unit)).toFixed(0).toString().replace(/(\d)(?=(?:\d{3})+$)/g,
|
|
148
|
-
return format.isShowZero ? numValue : Number(value) !== 0 ? numValue :
|
|
149
|
-
case
|
|
150
|
-
var monValue = "".concat((format === null || format === void 0 ? void 0 : format.prefix) ||
|
|
151
|
-
return format.isShowZero ? monValue : Number(value) !== 0 ? monValue :
|
|
152
|
-
case
|
|
147
|
+
var numValue = (format !== null && format !== void 0 && format.isThousands ? format !== null && format !== void 0 && format.decimalPlaces ? Number(Number(formatUnit(value, format.unit)).toFixed(format.decimalPlaces)).toLocaleString() : Number(formatUnit(value, format.unit)).toFixed(0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, "$1,") : Number(formatUnit(value, format.unit)).toFixed(format.decimalPlaces || 0)) + "".concat(format.unit || "");
|
|
148
|
+
return format.isShowZero ? numValue : Number(value) !== 0 ? numValue : "";
|
|
149
|
+
case "money":
|
|
150
|
+
var monValue = "".concat((format === null || format === void 0 ? void 0 : format.prefix) || "") + (format !== null && format !== void 0 && format.isThousands ? format !== null && format !== void 0 && format.decimalPlaces ? Number(Number(formatUnit(value, format.unit)).toFixed(format.decimalPlaces)).toLocaleString() : Number(formatUnit(value, format.unit)).toFixed(0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, "$1,") : Number(formatUnit(value, format.unit)).toFixed(format.decimalPlaces || 0)) + "".concat(format.unit || "") + "".concat((format === null || format === void 0 ? void 0 : format.suffix) || "");
|
|
151
|
+
return format.isShowZero ? monValue : Number(value) !== 0 ? monValue : "";
|
|
152
|
+
case "default":
|
|
153
153
|
default:
|
|
154
|
-
return format !== null && format !== void 0 && format.isShowZero ? value : Number(value) !== 0 ? value :
|
|
154
|
+
return format !== null && format !== void 0 && format.isShowZero ? value : Number(value) !== 0 ? value : "";
|
|
155
155
|
}
|
|
156
156
|
};
|
|
157
157
|
export var re = /[0-9]/;
|
|
158
|
-
export var isDomain = !(window.location.hostname ==
|
|
158
|
+
export var isDomain = !(window.location.hostname == "localhost" || re.test(window.location.host));
|
|
159
159
|
|
|
160
160
|
// 获取当前token
|
|
161
161
|
export var getToken = function getToken() {
|
|
162
162
|
// const { NODE_ENV } = process.env;
|
|
163
163
|
var domain = ".".concat(window.location.host);
|
|
164
164
|
// console.log('get', NODE_ENV, domain);
|
|
165
|
-
return Cookies.get(
|
|
166
|
-
path:
|
|
165
|
+
return Cookies.get("token", !isDomain ? undefined : {
|
|
166
|
+
path: "/",
|
|
167
167
|
domain: domain
|
|
168
168
|
});
|
|
169
169
|
};
|
|
170
170
|
export var rulesCustom = function rulesCustom(type) {
|
|
171
171
|
return regMap[type];
|
|
172
172
|
};
|
|
173
|
-
export var rules = function rules(required, entryType, label, entryAttr
|
|
174
|
-
) {
|
|
173
|
+
export var rules = function rules(required, entryType, label, entryAttr) {
|
|
175
174
|
if (!required) return [];
|
|
176
175
|
if (entryAttr && entryAttr.rulesType && rulesCustom(entryAttr.rulesType)) {
|
|
177
176
|
return [{
|
|
178
177
|
required: true,
|
|
179
178
|
message: "".concat(initLang({
|
|
180
|
-
id:
|
|
181
|
-
defaultValue:
|
|
182
|
-
})).concat(entryType && [
|
|
183
|
-
id:
|
|
184
|
-
defaultValue:
|
|
179
|
+
id: "rules.warning.please",
|
|
180
|
+
defaultValue: "请"
|
|
181
|
+
})).concat(entryType && ["Input", "InputNumber", "Textarea", "MbInput", "MbInputNumber", "MbTextarea"].includes(entryType) ? initLang({
|
|
182
|
+
id: "rules.warning.input",
|
|
183
|
+
defaultValue: "输入"
|
|
185
184
|
}) : initLang({
|
|
186
|
-
id:
|
|
187
|
-
defaultValue:
|
|
185
|
+
id: "rules.warning.select",
|
|
186
|
+
defaultValue: "选择"
|
|
188
187
|
})).concat(label)
|
|
189
188
|
}, entryAttr && entryAttr.rulesType && rulesCustom(entryAttr.rulesType) //默认类型存在添加
|
|
190
189
|
];
|
|
@@ -192,14 +191,14 @@ export var rules = function rules(required, entryType, label, entryAttr //默认
|
|
|
192
191
|
return [{
|
|
193
192
|
required: true,
|
|
194
193
|
message: "".concat(initLang({
|
|
195
|
-
id:
|
|
196
|
-
defaultValue:
|
|
197
|
-
})).concat(entryType && [
|
|
198
|
-
id:
|
|
199
|
-
defaultValue:
|
|
194
|
+
id: "rules.warning.please",
|
|
195
|
+
defaultValue: "请"
|
|
196
|
+
})).concat(entryType && ["Input", "InputNumber", "Textarea", "MbInput", "MbInputNumber", "MbTextarea"].includes(entryType) ? initLang({
|
|
197
|
+
id: "rules.warning.input",
|
|
198
|
+
defaultValue: "输入"
|
|
200
199
|
}) : initLang({
|
|
201
|
-
id:
|
|
202
|
-
defaultValue:
|
|
200
|
+
id: "rules.warning.select",
|
|
201
|
+
defaultValue: "选择"
|
|
203
202
|
})).concat(label)
|
|
204
203
|
}
|
|
205
204
|
// entryAttr && entryAttr.rulesType && rulesCustom(entryAttr.rulesType), //默认类型存在添加
|
|
@@ -237,7 +236,7 @@ export var matchCondition = function matchCondition(condition, value, cdtValue)
|
|
|
237
236
|
* @returns
|
|
238
237
|
*/
|
|
239
238
|
export var getMuilObjectValue = function getMuilObjectValue(keysStr, obj) {
|
|
240
|
-
var keys = keysStr.split(
|
|
239
|
+
var keys = keysStr.split(".");
|
|
241
240
|
var curObj = obj;
|
|
242
241
|
for (var i = 0; i < keys.length; i++) {
|
|
243
242
|
var _curObj;
|
|
@@ -245,7 +244,7 @@ export var getMuilObjectValue = function getMuilObjectValue(keysStr, obj) {
|
|
|
245
244
|
if (i == keys.length - 1) {
|
|
246
245
|
return nextValue;
|
|
247
246
|
} else {
|
|
248
|
-
if (_typeof(nextValue) !==
|
|
247
|
+
if (_typeof(nextValue) !== "object") {
|
|
249
248
|
return undefined;
|
|
250
249
|
}
|
|
251
250
|
curObj = nextValue;
|
|
@@ -258,14 +257,14 @@ export var handlePercentage = function handlePercentage(width) {
|
|
|
258
257
|
if (!width) return undefined;
|
|
259
258
|
// 如果参数是一个单个数字字符串,直接返回该字符串
|
|
260
259
|
if (/^\d+$/.test(width)) {
|
|
261
|
-
return width +
|
|
260
|
+
return width + "px";
|
|
262
261
|
}
|
|
263
262
|
|
|
264
263
|
// 如果参数包含百分比符号(%),则尝试提取百分比值并乘以页面宽度
|
|
265
|
-
if (width.includes(
|
|
264
|
+
if (width.includes("%")) {
|
|
266
265
|
var WDwidth = window.innerWidth; // 获取页面宽度
|
|
267
266
|
var percentage = parseFloat("".concat(WDwidth));
|
|
268
|
-
var widthNum = width.replace(
|
|
267
|
+
var widthNum = width.replace("%", "");
|
|
269
268
|
// const bodyElement = document.body;
|
|
270
269
|
// const percentage = bodyElement.offsetWidth;
|
|
271
270
|
if (!isNaN(percentage)) {
|
|
@@ -277,36 +276,38 @@ export var handlePercentage = function handlePercentage(width) {
|
|
|
277
276
|
// 如果都不符合,返回默认值
|
|
278
277
|
return undefined; // 或者你可以返回任何你想要的默认值
|
|
279
278
|
};
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
};
|
|
279
|
+
|
|
280
|
+
// export const buttonCount = (buttonConfig: any[], record: any[]) => {
|
|
281
|
+
// return buttonConfig.filter((item, index_) => {
|
|
282
|
+
// let status = true;
|
|
283
|
+
// // if (!item.config.showExpression) {
|
|
284
|
+
// // }
|
|
285
|
+
// if (item.config.showExpression && isString(item.config.showExpression)) {
|
|
286
|
+
// for (let index = 0; index < record.length; index++) {
|
|
287
|
+
// const element = record[index];
|
|
288
|
+
// if (!element || isEmpty(element)) {
|
|
289
|
+
// status = false;
|
|
290
|
+
// return;
|
|
291
|
+
// }
|
|
292
|
+
// try {
|
|
293
|
+
// const status_ = interpret(item.config.showExpression, element);
|
|
294
|
+
// if (status_ == false) {
|
|
295
|
+
// status = false;
|
|
296
|
+
// return;
|
|
297
|
+
// }
|
|
298
|
+
// } catch (error) {
|
|
299
|
+
// console.log("表达式错误", error);
|
|
300
|
+
// status = false;
|
|
301
|
+
// return;
|
|
302
|
+
// }
|
|
303
|
+
// }
|
|
304
|
+
// }
|
|
305
|
+
// return status;
|
|
306
|
+
// });
|
|
307
|
+
// };
|
|
308
|
+
|
|
308
309
|
export function flattenArrayObjects(arr) {
|
|
309
|
-
var children = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
310
|
+
var children = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "children";
|
|
310
311
|
var result = [];
|
|
311
312
|
if (!arr) return result;
|
|
312
313
|
for (var i = 0; i < arr.length; i++) {
|
|
@@ -324,7 +325,7 @@ export function flattenArrayObjects(arr) {
|
|
|
324
325
|
* @returns hex 16进制颜色值
|
|
325
326
|
*/
|
|
326
327
|
export var toHex = function toHex(n) {
|
|
327
|
-
return "".concat(n > 15 ?
|
|
328
|
+
return "".concat(n > 15 ? "" : 0).concat(n.toString(16));
|
|
328
329
|
};
|
|
329
330
|
|
|
330
331
|
/**
|
|
@@ -337,7 +338,7 @@ export var toHexString = function toHexString(colorObj) {
|
|
|
337
338
|
b = colorObj.b,
|
|
338
339
|
_colorObj$a = colorObj.a,
|
|
339
340
|
a = _colorObj$a === void 0 ? 1 : _colorObj$a;
|
|
340
|
-
return "#".concat(toHex(r)).concat(toHex(g)).concat(toHex(b)).concat(a === 1 ?
|
|
341
|
+
return "#".concat(toHex(r)).concat(toHex(g)).concat(toHex(b)).concat(a === 1 ? "" : toHex(Math.floor(a * 255)));
|
|
341
342
|
};
|
|
342
343
|
|
|
343
344
|
/**
|
|
@@ -413,12 +414,12 @@ export var parseRgbaColor = function parseRgbaColor(color, op) {
|
|
|
413
414
|
* @returns IColorObj
|
|
414
415
|
*/
|
|
415
416
|
export var parseColorString = function parseColorString(color, op) {
|
|
416
|
-
if (color.startsWith(
|
|
417
|
+
if (color.startsWith("#")) {
|
|
417
418
|
return parseHexColor(color, op);
|
|
418
|
-
} else if (color.startsWith(
|
|
419
|
+
} else if (color.startsWith("rgb")) {
|
|
419
420
|
return parseRgbaColor(color, op);
|
|
420
|
-
} else if (color ===
|
|
421
|
-
return parseHexColor(
|
|
421
|
+
} else if (color === "transparent") {
|
|
422
|
+
return parseHexColor("#00000000");
|
|
422
423
|
}
|
|
423
424
|
throw new Error("color string error: ".concat(color));
|
|
424
425
|
};
|