@zgfe/modules-page 1.0.17-zhongyuan.12 → 1.0.17-zhongyuan.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.
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useEffect, useRef } from 'react';
2
2
  import { ModulesPage } from '@zgfe/modules-page';
3
3
  import { DemoWrapper } from '@zgfe/business-lib';
4
4
  // const defaultValue = {
@@ -61,6 +61,24 @@ export default (function () {
61
61
  var onChange = function onChange(data) {
62
62
  console.log('onChange:', data);
63
63
  };
64
+ var pageDeta = useRef(null);
65
+ useEffect(function () {
66
+ setTimeout(function () {
67
+ console.log(pageDeta.current.searchFn({
68
+ appId: 1,
69
+ module: 'page',
70
+ pageTitle: '数据分析',
71
+ pageUrl: 'file:///C:/Users/Administrator/Desktop/index.html',
72
+ platform: 3,
73
+ time: {
74
+ unit: 'day',
75
+ end: '2025-09-19',
76
+ begin: '2025-09-16'
77
+ },
78
+ userGroup: [0]
79
+ }), 'pageDeta');
80
+ }, 1000);
81
+ }, []);
64
82
  return /*#__PURE__*/React.createElement(DemoWrapper, {
65
83
  needMeta: true,
66
84
  defaultApp: 2
@@ -70,6 +88,7 @@ export default (function () {
70
88
  overflow: 'auto'
71
89
  }
72
90
  }, /*#__PURE__*/React.createElement(ModulesPage, {
91
+ ref: pageDeta,
73
92
  onClickWarn: onClickWarn,
74
93
  onChange: onChange,
75
94
  isAppAnalysis: true
@@ -1,5 +1,8 @@
1
1
  import React from 'react';
2
2
  import './style/index.less';
3
3
  import { ModulesPageTypes } from './types';
4
- declare const ModulesPage: React.FC<ModulesPageTypes.Props>;
4
+ export type MyRefType = {
5
+ searchFn: Function | null;
6
+ };
7
+ declare const ModulesPage: React.ForwardRefExoticComponent<ModulesPageTypes.Props & React.RefAttributes<MyRefType>>;
5
8
  export default ModulesPage;
@@ -10,7 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
13
+ import React, { useContext, useEffect, useMemo, useRef, useState, useImperativeHandle } from 'react';
14
14
  import EmptyPanel from "../empty";
15
15
  import { BizGlobalDataContext, BizLayout, BizLoading } from '@zgfe/business-lib';
16
16
  import { Button, Skeleton, Spin } from 'antd';
@@ -24,7 +24,7 @@ import { getPageGroupList, getPageList, getPageResult, onDownload as _onDownload
24
24
  import DetailContent from "../../components/detail";
25
25
  import _ from 'lodash';
26
26
  var classPrefix = 'modules-page';
27
- var ModulesPage = function ModulesPage(props) {
27
+ var ModulesPage = /*#__PURE__*/React.forwardRef(function (props, ref) {
28
28
  // 页面类型
29
29
  var _useState = useState('page'),
30
30
  _useState2 = _slicedToArray(_useState, 2),
@@ -227,6 +227,13 @@ var ModulesPage = function ModulesPage(props) {
227
227
  }
228
228
  });
229
229
  };
230
+
231
+ // 定义通过ref暴露给父组件的内容
232
+ useImperativeHandle(ref, function () {
233
+ return {
234
+ searchFn: setSearchValue
235
+ };
236
+ }, []);
230
237
  var render = /*#__PURE__*/React.createElement("div", {
231
238
  className: "".concat(classPrefix, "-top-render")
232
239
  }, /*#__PURE__*/React.createElement("div", {
@@ -254,7 +261,7 @@ var ModulesPage = function ModulesPage(props) {
254
261
  setCurrentClickPage: setCurrentClickPage,
255
262
  isAppAnalysis: isAppAnalysis
256
263
  }
257
- }, /*#__PURE__*/React.createElement(BizLayout, {
264
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizLayout, {
258
265
  className: classPrefix
259
266
  // title="页面分析"
260
267
  ,
@@ -307,6 +314,6 @@ var ModulesPage = function ModulesPage(props) {
307
314
  return setShowGroup(false);
308
315
  },
309
316
  onOk: onOk
310
- }) : null)));
311
- };
317
+ }) : null))));
318
+ });
312
319
  export default ModulesPage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-page",
3
- "version": "1.0.17-zhongyuan.12",
3
+ "version": "1.0.17-zhongyuan.14",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -57,5 +57,5 @@
57
57
  "rc-virtual-list": "^3.14.2",
58
58
  "yorkie": "^2.0.0"
59
59
  },
60
- "gitHead": "8f45bf921247d166ddbdc3e2c925331aacba7cf7"
60
+ "gitHead": "052c30d1c78ba4f0e47241180e9b26e195a291b4"
61
61
  }