ls-pro-common 3.1.64 → 3.1.66

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.
@@ -6,5 +6,5 @@ import { ApiResponse } from '../typing';
6
6
  * @param taskName 后台任务名称,
7
7
  * @returns
8
8
  */
9
- declare const taskProcess: (taskId: string, taskName: string | undefined, callback: (result: ApiResponse | false) => void) => void;
9
+ declare const taskProcess: (taskId: string, taskName?: string, callback?: ((result: ApiResponse | false) => void) | undefined) => void;
10
10
  export default taskProcess;
@@ -16,7 +16,7 @@ var taskProcess = function taskProcess(taskId) {
16
16
  var taskName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
17
17
  var callback = arguments.length > 2 ? arguments[2] : undefined;
18
18
  if (!taskId) {
19
- callback(false);
19
+ callback === null || callback === void 0 ? void 0 : callback(false);
20
20
  return;
21
21
  }
22
22
  var exit = false;
@@ -83,7 +83,7 @@ var taskProcess = function taskProcess(taskId) {
83
83
  })),
84
84
  onClose: function onClose() {
85
85
  exit = true;
86
- callback(false);
86
+ callback === null || callback === void 0 ? void 0 : callback(false);
87
87
  document.removeEventListener('mouseup', onUp);
88
88
  document.removeEventListener('mousemove', onMove);
89
89
  }
@@ -105,7 +105,7 @@ var taskProcess = function taskProcess(taskId) {
105
105
  var row = rows === null || rows === void 0 ? void 0 : rows[0];
106
106
  if (!row) {
107
107
  showError('获取任务进度失败,请在消息中心查看任务结果');
108
- callback(result);
108
+ callback === null || callback === void 0 ? void 0 : callback(result);
109
109
  _notification.close(key);
110
110
  } else {
111
111
  var status = row.status,
@@ -127,21 +127,21 @@ var taskProcess = function taskProcess(taskId) {
127
127
  showWarn('任务已终止,请在消息中心查看任务结果');
128
128
  }
129
129
  sleep(1.5).then(function () {
130
- callback(result);
131
130
  _notification.close(key);
131
+ callback === null || callback === void 0 ? void 0 : callback(result);
132
132
  });
133
133
  }
134
134
  }
135
135
  }).catch(function () {
136
136
  showError('获取任务进度失败,请在消息中心查看任务结果');
137
- callback({
137
+ _notification.close(key);
138
+ callback === null || callback === void 0 ? void 0 : callback({
138
139
  flag: {
139
140
  retCode: '9999',
140
141
  retMsg: '获取任务进度失败,请在消息中心查看任务结果'
141
142
  },
142
143
  success: false
143
144
  });
144
- _notification.close(key);
145
145
  });
146
146
  };
147
147
  sleep(1).then(function () {
package/es/utils/url.js CHANGED
@@ -13,6 +13,17 @@ export var getUrlQuery = function getUrlQuery(name) {
13
13
  var r = url.match(reg);
14
14
  if (r != null) {
15
15
  return decodeURIComponent(decodeURI(r[2]));
16
+ } else if (url === location.search.slice(1)) {
17
+ // 如果参数放在hash后面,则需要从href中获取.
18
+ url = location.href;
19
+ var _r = url.match(reg);
20
+ if (_r != null) {
21
+ var value = decodeURIComponent(decodeURI(_r[2]));
22
+ if (value === null || value === void 0 ? void 0 : value.includes('#/')) {
23
+ return value.split('#/')[0];
24
+ }
25
+ return value;
26
+ }
16
27
  }
17
28
  return '';
18
29
  };
@@ -6,5 +6,5 @@ import { ApiResponse } from '../typing';
6
6
  * @param taskName 后台任务名称,
7
7
  * @returns
8
8
  */
9
- declare const taskProcess: (taskId: string, taskName: string | undefined, callback: (result: ApiResponse | false) => void) => void;
9
+ declare const taskProcess: (taskId: string, taskName?: string, callback?: ((result: ApiResponse | false) => void) | undefined) => void;
10
10
  export default taskProcess;
@@ -16,7 +16,7 @@ var taskProcess = function taskProcess(taskId) {
16
16
  var taskName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
17
17
  var callback = arguments.length > 2 ? arguments[2] : undefined;
18
18
  if (!taskId) {
19
- callback(false);
19
+ callback === null || callback === void 0 ? void 0 : callback(false);
20
20
  return;
21
21
  }
22
22
  var exit = false;
@@ -83,7 +83,7 @@ var taskProcess = function taskProcess(taskId) {
83
83
  })),
84
84
  onClose: function onClose() {
85
85
  exit = true;
86
- callback(false);
86
+ callback === null || callback === void 0 ? void 0 : callback(false);
87
87
  document.removeEventListener('mouseup', onUp);
88
88
  document.removeEventListener('mousemove', onMove);
89
89
  }
@@ -105,7 +105,7 @@ var taskProcess = function taskProcess(taskId) {
105
105
  var row = rows === null || rows === void 0 ? void 0 : rows[0];
106
106
  if (!row) {
107
107
  showError('获取任务进度失败,请在消息中心查看任务结果');
108
- callback(result);
108
+ callback === null || callback === void 0 ? void 0 : callback(result);
109
109
  _notification.close(key);
110
110
  } else {
111
111
  var status = row.status,
@@ -127,21 +127,21 @@ var taskProcess = function taskProcess(taskId) {
127
127
  showWarn('任务已终止,请在消息中心查看任务结果');
128
128
  }
129
129
  sleep(1.5).then(function () {
130
- callback(result);
131
130
  _notification.close(key);
131
+ callback === null || callback === void 0 ? void 0 : callback(result);
132
132
  });
133
133
  }
134
134
  }
135
135
  }).catch(function () {
136
136
  showError('获取任务进度失败,请在消息中心查看任务结果');
137
- callback({
137
+ _notification.close(key);
138
+ callback === null || callback === void 0 ? void 0 : callback({
138
139
  flag: {
139
140
  retCode: '9999',
140
141
  retMsg: '获取任务进度失败,请在消息中心查看任务结果'
141
142
  },
142
143
  success: false
143
144
  });
144
- _notification.close(key);
145
145
  });
146
146
  };
147
147
  sleep(1).then(function () {
package/lib/utils/url.js CHANGED
@@ -13,6 +13,17 @@ export var getUrlQuery = function getUrlQuery(name) {
13
13
  var r = url.match(reg);
14
14
  if (r != null) {
15
15
  return decodeURIComponent(decodeURI(r[2]));
16
+ } else if (url === location.search.slice(1)) {
17
+ // 如果参数放在hash后面,则需要从href中获取.
18
+ url = location.href;
19
+ var _r = url.match(reg);
20
+ if (_r != null) {
21
+ var value = decodeURIComponent(decodeURI(_r[2]));
22
+ if (value === null || value === void 0 ? void 0 : value.includes('#/')) {
23
+ return value.split('#/')[0];
24
+ }
25
+ return value;
26
+ }
16
27
  }
17
28
  return '';
18
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ls-pro-common",
3
- "version": "3.1.64",
3
+ "version": "3.1.66",
4
4
  "description": "ls-pro-common",
5
5
  "license": "MIT",
6
6
  "sideEffects": [