Skip to content

Commit

Permalink
更新兼容electron的运行
Browse files Browse the repository at this point in the history
  • Loading branch information
duolabmeng6 committed Aug 4, 2024
1 parent 10c5506 commit bee2248
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 14 deletions.
31 changes: 27 additions & 4 deletions GoEasyDesigner/frontend/src/action/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,13 @@ appAction._打开项目设计文件 = function (filepath) {
store.项目信息.窗口事件文件路径 = 取父目录(filepath) + "/event.js"
store.项目信息.辅助代码文件路径 = 取父目录(filepath) + "/__aux_code.js"
store.项目信息.项目管理目录 = 取父目录(filepath)
store.项目信息.项目根目录 = 取父目录(取父目录(取父目录(取父目录(filepath))))
//检查路径设计文件路径是否包含 renderer
if (store.项目信息.设计文件路径.indexOf("renderer") == -1){
store.项目信息.项目根目录 = 取父目录(取父目录(取父目录(取父目录(filepath))))
}else{
store.项目信息.项目根目录 = 取父目录(取父目录(取父目录(取父目录(取父目录(filepath)))))

}
}

appAction._打开文件加载界面 = async function (filepath) {
Expand Down Expand Up @@ -259,7 +265,7 @@ appAction.设计区域被改变 = function () {
}


appAction.运行 = function () {
appAction.运行 = async function () {
if (store.客户端模式 == false) {
//弹出提示
ElMessage({
Expand All @@ -283,11 +289,28 @@ appAction.运行 = function () {
store.运行按钮文本 = t("app.stop")
store.调试信息 = t("app.inOperation")
store.选择夹_底部现行选中项 = "1"
E运行命令(store.项目信息.项目根目录, "wails dev -nocolour")
let ptext = await E读入文件(store.项目信息.项目根目录+"/package.json")
// console.log("ptext",ptext)
// console.log("store.项目信息.项目根目录",store.项目信息.项目根目录)
let devShell = "wails dev -nocolour"
try{
let pjson = JSON.parse(ptext)
if (pjson.scripts.dev !== undefined){
devShell = 'npm run dev'
}
}catch (e) {

}
console.log("devShell",devShell)
console.log("项目根目录",store.项目信息.项目根目录)

E运行命令(store.项目信息.项目根目录, devShell)

// E运行命令(store.项目信息.项目根目录, "wails dev -nocolour")
} else {
store.调试信息 = t('app.stopped')
store.运行按钮文本 = t("app.run")
E停止命令()
// E停止命令()
}

}
Expand Down
13 changes: 12 additions & 1 deletion GoEasyDesigner/frontend/src/app11.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,18 @@
</el-col>
</el-row>
</el-collapse-item>

<el-collapse-item :title="$t('app.tw_components')" name="4">
<el-row>
<el-col v-for="(item, index) in BoxComponentNames['tailwindcss']" :span="24" style="margin-bottom: 8px">
<t-button theme="default" class="full-width-button" draggable="true"
style="width: 100%;text-align: left;"
@dragstart="拖拽开始($event, item,'tw')"
>
{{ $te('componentName.' + item) ? $t('componentName.' + item) : item }}
</t-button>
</el-col>
</el-row>
</el-collapse-item>

</el-collapse>
</el-tab-pane>
Expand Down
4 changes: 1 addition & 3 deletions GoEasyDesigner/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/duolabmeng6/goefun v1.3.6
github.com/fsnotify/fsnotify v1.5.4
github.com/ncruces/zenity v0.10.10
github.com/wailsapp/wails/v2 v2.7.0
github.com/wailsapp/wails/v2 v2.6.0
)

require (
Expand All @@ -18,7 +18,6 @@ require (
github.com/bep/debounce v1.2.1 // indirect
github.com/dchest/jsmin v0.0.0-20220218165748-59f39799265f // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gogf/gf/v2 v2.4.1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
Expand All @@ -31,7 +30,6 @@ require (
github.com/leaanthony/go-ansi-parser v1.6.0 // indirect
github.com/leaanthony/gosod v1.0.3 // indirect
github.com/leaanthony/slicer v1.6.0 // indirect
github.com/leaanthony/u v1.1.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
Expand Down
8 changes: 2 additions & 6 deletions GoEasyDesigner/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg
github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogf/gf/v2 v2.4.1 h1:snsuvDhNFiRoAuWBbKfIIng0KyMaRA87Qr03GLir5j8=
github.com/gogf/gf/v2 v2.4.1/go.mod h1:tsbmtwcAl2chcYoq/fP9W2FZf06aw4i89X34nbSHo9Y=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
Expand Down Expand Up @@ -92,8 +90,6 @@ github.com/leaanthony/gosod v1.0.3/go.mod h1:BJ2J+oHsQIyIQpnLPjnqFGTMnOZXDbvWtRC
github.com/leaanthony/slicer v1.5.0/go.mod h1:FwrApmf8gOrpzEWM2J/9Lh79tyq8KTX5AzRtwV7m4AY=
github.com/leaanthony/slicer v1.6.0 h1:1RFP5uiPJvT93TAHi+ipd3NACobkW53yUiBqZheE/Js=
github.com/leaanthony/slicer v1.6.0/go.mod h1:o/Iz29g7LN0GqH3aMjWAe90381nyZlDNquK+mtH2Fj8=
github.com/leaanthony/u v1.1.0 h1:2n0d2BwPVXSUq5yhe8lJPHdxevE2qK5G99PMStMZMaI=
github.com/leaanthony/u v1.1.0/go.mod h1:9+o6hejoRljvZ3BzdYlVL0JYCwtnAsVuN9pVTQcaRfI=
github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo=
Expand Down Expand Up @@ -160,8 +156,8 @@ github.com/wailsapp/go-webview2 v1.0.10 h1:PP5Hug6pnQEAhfRzLCoOh2jJaPdrqeRgJKZhy
github.com/wailsapp/go-webview2 v1.0.10/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs=
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
github.com/wailsapp/wails/v2 v2.7.0 h1:elExDJ2DjvAM9QDEUy1pJ8O5PiCUFqLx81MEtPg0zWQ=
github.com/wailsapp/wails/v2 v2.7.0/go.mod h1:pZ6Q2w5mWcXbB2behNX8jC5G0UNw2gc5I8jbriy4Hko=
github.com/wailsapp/wails/v2 v2.6.0 h1:EyH0zR/EO6dDiqNy8qU5spaXDfkluiq77xrkabPYD4c=
github.com/wailsapp/wails/v2 v2.6.0/go.mod h1:WBG9KKWuw0FKfoepBrr/vRlyTmHaMibWesK3yz6nNiM=
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.opentelemetry.io/otel v1.7.0 h1:Z2lA3Tdch0iDcrhJXDIlC94XE+bxok1F9B+4Lz/lGsM=
Expand Down

0 comments on commit bee2248

Please sign in to comment.