From 2f8535fd8b65c53a3d329db3cff27a8ced5120e9 Mon Sep 17 00:00:00 2001 From: "Xc@centOs" Date: Fri, 29 Jul 2022 12:29:57 +0800 Subject: [PATCH] =?UTF-8?q?template=E4=B8=AD=E5=A2=9E=E5=8A=A0=E4=BA=86deb?= =?UTF-8?q?ugPanel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/locales/build-locales.js | 3 ++- template/web/src/App.tsx | 45 +++++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/scripts/locales/build-locales.js b/scripts/locales/build-locales.js index 904f372..e5510b0 100644 --- a/scripts/locales/build-locales.js +++ b/scripts/locales/build-locales.js @@ -112,7 +112,8 @@ function findLocaleFiles(json, path, name = '', buildPath, nodeEnv, platform) { } function listenerLocaleFiles(path, buildPath, nodeEnv, platform) { - fs.watch(path, { recursive: true }, (eventType, filename) => { + // todo linux下不支持recursive监控,以后再说 + fs.watch(path, process.platform !== 'linux' ? { recursive: true } : {}, (eventType, filename) => { const fPath = Path.resolve(path, filename).replace(/\\/g, '/'); console.log('\nThe file', fPath, 'was modified!'); console.log('The type of change was:', eventType); diff --git a/template/web/src/App.tsx b/template/web/src/App.tsx index c5a93a1..690bb0f 100644 --- a/template/web/src/App.tsx +++ b/template/web/src/App.tsx @@ -1,12 +1,15 @@ -import React from 'react'; +import React, { useState } from 'react'; import { Routes, Route } from 'react-router-dom'; +import { Button, Drawer } from 'tdesign-react'; +import { ChevronUpIcon } from 'tdesign-icons-react' import './App.less'; import LazyLoad from './utils/lazyLoad'; const Console = LazyLoad(() => import('./template/console')); const Frontend = LazyLoad(() => import('./template/frontend')); const NotFound = LazyLoad(() => import('./template/notFound')); -const Message = LazyLoad(() =>import('@oak-general-business/components/message')); +const Message = LazyLoad(() => import('@oak-general-business/components/message')); +const DebugPanel = LazyLoad(() => import('@oak-general-business/components/Func/debugPanel')); type Router = { path: string; @@ -30,6 +33,14 @@ function getRoutes(routers2: Router[], namespace?: string) { let routers: Router[] = []; function App() { + const [visible, setVisible] = useState(false); + + const handleClick = () => { + setVisible(true); + }; + const handleClose = () => { + setVisible(false); + }; return ( {Message} @@ -41,7 +52,35 @@ function App() { {getRoutes(routers)} - + + { + process.env.NODE_ENV === "development" && ( + +