@vtx/modals2 5.0.60 → 5.0.61

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.
@@ -19,6 +19,7 @@ import { useState } from 'react';
19
19
  import { VmEmpty, VmProgress, VmTable, VmTag, VmWrapper } from "../../../_components";
20
20
  import useSettings from "../../../_hooks/useSettings";
21
21
  import { BaseService } from "../../api";
22
+ import { buildIframeQuery } from "../../utils/url";
22
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
24
  var Work = function Work(props) {
24
25
  var id = props.id,
@@ -124,7 +125,14 @@ var Work = function Work(props) {
124
125
  if (prefixList.length === 2) {
125
126
  prefix = "/".concat(prefixList[0]);
126
127
  }
127
- var src = "".concat(prefix, "/carHistory/#/zyqsHistory?carId=").concat(record.carId, "&theme=").concat(theme === 'blue' ? 'dark' : theme, "&startTime=").concat(dayjs(date).format('YYYY-MM-DD 00:00:00'), "&endTime=").concat(dayjs(date).format('YYYY-MM-DD 23:59:59'), "&").concat(location.href.split('?')[1], "&roadId=").concat(record.roadId);
128
+ var query = buildIframeQuery(location.href.split('?')[1], {
129
+ carId: record.carId,
130
+ theme: theme === 'blue' ? 'dark' : theme,
131
+ startTime: dayjs(date).format('YYYY-MM-DD 00:00:00'),
132
+ endTime: dayjs(date).format('YYYY-MM-DD 23:59:59'),
133
+ roadId: record.roadId
134
+ });
135
+ var src = "".concat(prefix, "/carHistory/#/zyqsHistory?").concat(query);
128
136
  setIframeModalInfo({
129
137
  title: '车辆轨迹',
130
138
  visible: true,
@@ -18,6 +18,7 @@ import { useMemo, useState } from 'react';
18
18
  import { VmBarCharts, VmEmpty, VmProgress, VmTable, VmTag, VmWrapper } from "../../../_components";
19
19
  import useSettings from "../../../_hooks/useSettings";
20
20
  import { LaneService } from "../../api";
21
+ import { buildIframeQuery } from "../../utils/url";
21
22
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
23
  export var getPercentInfo = function getPercentInfo(percent) {
23
24
  var colorList = ['#D9D9D9', '#D9D9D9'];
@@ -219,7 +220,13 @@ var Work = function Work(props) {
219
220
  if (prefixList.length === 2) {
220
221
  prefix = "/".concat(prefixList[0]);
221
222
  }
222
- var src = "".concat(prefix, "/carHistory/#/zyqsLaneHistory?carId=").concat(record.workCarId, "&theme=").concat(theme === 'blue' ? 'dark' : theme, "&startTime=").concat(dayjs(date).format('YYYY-MM-DD 00:00:00'), "&endTime=").concat(dayjs(date).format('YYYY-MM-DD 23:59:59'), "&").concat(location.href.split('?')[1]);
223
+ var query = buildIframeQuery(location.href.split('?')[1], {
224
+ carId: record.workCarId,
225
+ theme: theme === 'blue' ? 'dark' : theme,
226
+ startTime: dayjs(date).format('YYYY-MM-DD 00:00:00'),
227
+ endTime: dayjs(date).format('YYYY-MM-DD 23:59:59')
228
+ });
229
+ var src = "".concat(prefix, "/carHistory/#/zyqsLaneHistory?").concat(query);
223
230
  setIframeModalInfo({
224
231
  title: '车辆轨迹',
225
232
  visible: true,
@@ -0,0 +1,12 @@
1
+ export var buildIframeQuery = function buildIframeQuery() {
2
+ var routeQuery = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4
+ var searchParams = new URLSearchParams(routeQuery || '');
5
+ Object.keys(params).forEach(function (key) {
6
+ var value = params[key];
7
+ if (value !== undefined && value !== null) {
8
+ searchParams.set(key, value);
9
+ }
10
+ });
11
+ return searchParams.toString();
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtx/modals2",
3
- "version": "5.0.60",
3
+ "version": "5.0.61",
4
4
  "description": "弹窗组件",
5
5
  "license": "MIT",
6
6
  "module": "lib/index.js",