-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
252 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
store/demo/live-control-robot/src/views/page0/index.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<template> | ||
<div class="page">loading...</div> | ||
</template> | ||
|
||
<script setup> | ||
const ws = globalThis.ws | ||
new Promise(async () => { | ||
console.log(111, window.sys.hwnd) | ||
const [, winformInfo] = await ws.call( | ||
`run`, | ||
[ | ||
` | ||
var winform = win._form.getForm(${window.sys.hwnd}) | ||
winform.show(false) | ||
return { | ||
left: winform.left, | ||
top: winform.top, | ||
right: winform.right, | ||
bottom: winform.bottom, | ||
} | ||
`, | ||
], | ||
{ | ||
runType: `main`, | ||
}, | ||
) | ||
custom(winformInfo) | ||
function custom(winformInfo) { | ||
const boxUrl = location.origin + location.pathname + `#/page1` | ||
const arg = { | ||
title: document.title, | ||
boxUrl, | ||
toExit: true, // 关闭时是否退出主程序 | ||
} | ||
console.log(`winformInfo`, winformInfo) | ||
ws.call( | ||
`run`, | ||
[ | ||
` | ||
var winformInfo = global.G.config.form | ||
var arg = ... | ||
var winformSub = win.form({ | ||
text: arg.title; | ||
right: 1400; | ||
bottom: 900; | ||
}) | ||
global.G.winformSub = winformSub | ||
global.G.winformSub.orphanWindow() | ||
global.G.winformSub.add( | ||
page={ | ||
cls="custom"; | ||
transparent=1; | ||
z=2 | ||
}; | ||
box={ | ||
cls="custom"; | ||
left=50; | ||
top=100; | ||
right=900; | ||
bottom=700; | ||
ah=1; | ||
aw=1; | ||
transparent=1; | ||
z=1 | ||
} | ||
) | ||
var wbBox = web.view( global.G.winformSub.box ) | ||
global.G.winformSub.wbBox = wbBox | ||
// 挂载到 window.ext 上的对象 | ||
global.G.winformSub.wbBox.external = web.json.stringify({ | ||
token = global.G.token; | ||
wsUrl = global.G.wsUrl; | ||
hwnd = global.G.winformSub.hwnd; | ||
}) | ||
// 页面每次刷新都会运行 | ||
var old = global.G.winformSub.wbBox.preloadScript | ||
global.G.winformSub.wbBox.preloadScript = function(js) { | ||
js = '\n\n' + js + '\n\n' | ||
call(old, owner, js) | ||
} | ||
global.G.winformSub.wbBox.preloadScript(\`(() => { | ||
window._ext = chrome.webview.hostObjects.external | ||
delete window.aardio | ||
})()\`) | ||
global.G.winformSub.wbBox.preloadScript(string.load(global.G.appDataPath + "/res/browser/main.umd.min.js")) | ||
global.G.winformSub.wbBox.go(arg.boxUrl) | ||
global.G.winformSub.text = global.G.winformSub.wbBox.xcall("() => document.title") | ||
global.G.winformSub.wbBox.defaultBackgroundColor = 0 | ||
global.G.winformSub.onClose = function() { | ||
if(arg.toExit) global.G.killAll() | ||
} | ||
global.G.winformSub.show(); | ||
`, | ||
arg, | ||
], | ||
{ | ||
runType: `main`, | ||
}, | ||
) | ||
} | ||
}) | ||
</script> | ||
|
||
<style scoped lang="less"> | ||
.page { | ||
// background-color: #ccc; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<template> | ||
<div class="page p20px"> | ||
<div class="page"> | ||
<h3 text-center>平台选择</h3> | ||
<avue-crud | ||
:data="data" | ||
|
Oops, something went wrong.