mirror of
https://gitee.com/openharmony/developtools_profiler
synced 2024-11-23 15:00:17 +00:00
初始化窗口按需加载
Signed-off-by: 钱玉英 <qianyuying@huawei.com>
This commit is contained in:
parent
4c38ab9cf8
commit
f961846cd5
@ -15,7 +15,7 @@
|
||||
import { secToTime } from '../common/utils/TimeUtils';
|
||||
import { TaskStatus } from '../common/profiler/base/ProfilerConstant';
|
||||
import { ProfilerTask } from '../common/profiler/ProfilerTask';
|
||||
import { initFloatWindow, destoryAllFloatWindow } from '../common/ui/floatwindow/utils/FloatWindowUtils';
|
||||
import { destoryAllFloatWindow } from '../common/ui/floatwindow/utils/FloatWindowUtils';
|
||||
import WorkerHandler from '../common/profiler/WorkerHandler';
|
||||
import worker from '@ohos.worker';
|
||||
let mainWorker = globalThis.MainWorker
|
||||
@ -47,7 +47,6 @@ struct FloatBall {
|
||||
globalThis.CreateTitleWindow()
|
||||
console.log('cm-floatBall-CreateTitleWindow2')
|
||||
globalThis.task_status = TaskStatus.task_init
|
||||
initFloatWindow()
|
||||
console.log('cm-floatBall-CreateTitleWindow3')
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { TIndexInfo } from '../common/entity/DatabaseEntity';
|
||||
import { showFloatWindow, hideFloatWindow } from '../common/ui/floatwindow/utils/FloatWindowUtils';
|
||||
import { initFloatWindow, showFloatWindow, hideFloatWindow } from '../common/ui/floatwindow/utils/FloatWindowUtils';
|
||||
import { getCpuCoreInfo} from '../common/utils/SystemUtils';
|
||||
import FloatWindowConstant from '../common/ui/floatwindow/FloatWindowConstant';
|
||||
import CommonEvent from '@ohos.commonEvent';
|
||||
@ -50,6 +50,7 @@ struct TitleWindowPage {
|
||||
offsetX: number = -1
|
||||
offsetY: number = -1
|
||||
cpuCoreArr: Array<Number>
|
||||
@State isInitFloatWindow: boolean = false
|
||||
aboutToAppear() {
|
||||
|
||||
this.cpuCoreArr = getCpuCoreInfo().map(Number).sort()
|
||||
@ -107,6 +108,10 @@ struct TitleWindowPage {
|
||||
}
|
||||
|
||||
floatWindowEvent(floatName: string, flag: number) {
|
||||
if (!this.isInitFloatWindow) {
|
||||
initFloatWindow()
|
||||
this.isInitFloatWindow = true
|
||||
}
|
||||
if (this.data[flag]) {
|
||||
hideFloatWindow(floatName)
|
||||
this.data[flag] = false
|
||||
|
Loading…
Reference in New Issue
Block a user