Skip to content

Commit

Permalink
发布,优化各种操作体验
Browse files Browse the repository at this point in the history
  • Loading branch information
duolabmeng6 committed Nov 12, 2023
1 parent 159b7fa commit b9569d8
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 22 deletions.
4 changes: 4 additions & 0 deletions GoEasyDesigner/frontend/src/action/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,12 @@ appAction.打开 = async function () {
console.log(data)
// 初始化界面(data)
store.list = JSON.parse(data)
store.取组件列表()

}
}
input.click()

return
}

Expand All @@ -102,6 +105,7 @@ appAction.打开 = async function () {
return
}
appAction._打开文件加载界面(文件路径)

}
appAction._打开项目设计文件 = function (filepath) {
store.项目信息.设计文件路径 = filepath
Expand Down
27 changes: 17 additions & 10 deletions GoEasyDesigner/frontend/src/app11.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
<el-tabs style="height: 100%" type="border-card">
<DraggableDivider :target-element-id="'left'"></DraggableDivider>

<el-tab-pane :label="$t('app.Attribute')" style="height: 100%;">
<div id="tabLeftAttr" class="app2" style="margin: 8px 4px">
<div v-if="store.当前拖拽组件数据 != undefined" class="组件列表">
<el-tab-pane id="tabLeftAttrPane" :label="$t('app.Attribute')" style="height: 100%;" :style="{
height: tabContentHight + 'px',
}">
<div id="tabLeftAttr" class="app2" style="height: 100%;">
<div v-if="store.当前拖拽组件数据 != undefined" class="组件列表" style="padding-top: 10px; padding-left: 6px; padding-right: 6px;">
<el-tree-select
v-model="store.当前组件索引"
:data="store.组件列表tree"
Expand Down Expand Up @@ -171,7 +173,6 @@
<el-dropdown-item @click="appAction.新建()"> {{ $t('app.new') }}</el-dropdown-item>
<el-dropdown-item @click="appAction.打开">{{ $t('app.open') }}</el-dropdown-item>
<el-dropdown-item @click="appAction.保存设计文件()">{{ $t('app.save') }}</el-dropdown-item>
<el-dropdown-item @click="appAction.帮助()">{{ $t('app.help') }}</el-dropdown-item>
<el-dropdown-item @click="appAction.运行环境检测()">{{ $t('app.environmentCheck') }}</el-dropdown-item>
<el-dropdown-item @click="e => store.显示项目配置对话框 = true">
{{ $t('app.projectConfig') }}
Expand All @@ -181,16 +182,20 @@
</el-dropdown>

<el-button-group class="">
<el-button :icon="Key" @click="appAction.运行()">{{ store.运行按钮文本 }}</el-button>
<el-button :icon="Key" @click="appAction.编译()">{{ store.编译按钮文本 }}</el-button>
<el-button v-if="store.客户端模式" :icon="Help" @click="appAction.检查更新()">{{
<t-button theme="default" :icon="Key" @click="appAction.运行()">{{ store.运行按钮文本 }}</t-button>
<t-button theme="default" :icon="Key" @click="appAction.编译()">{{ store.编译按钮文本 }}</t-button>

<t-button theme="default" v-if="store.客户端模式" :icon="Help" @click="appAction.检查更新()">{{
$t('app.updateCheck')
}}
</el-button>
<el-button v-if="!store.客户端模式" :icon="Help" @click="appAction.下载客户端()">{{
</t-button>
<t-button theme="default" v-if="!store.客户端模式" :icon="Help" @click="appAction.下载客户端()">{{
$t('app.downloadClient')
}}
</el-button>
</t-button>
<t-button theme="default" :icon="Help" @click="appAction.帮助()">{{ $t('app.help') }}</t-button>


</el-button-group>
</el-col>
<el-col :span="4">
Expand Down Expand Up @@ -321,6 +326,8 @@ async function ReSize() {
tabMainVal.querySelector('#designer').style.height = tabContentHight.value - 16 + 'px'
document.querySelector('#tabLeftSuper').style.height = tabContentHight.value + 'px'
document.querySelector('#tabLeftProject').style.height = tabContentHight.value + 'px'
document.querySelector('#tabLeftAttrPane').style.height = tabContentHight.value + 'px'
// document.querySelector('#left > div > div.el-tabs__content').style.height = tabContentHight.value - 16 + 'px'
tabMainVal.querySelector('#codeEdit').style.height = tabContentHight.value - 16 + 'px'
Expand Down
1 change: 1 addition & 0 deletions GoEasyDesigner/frontend/src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ html, body{
.属性表格 {
grid-area: 属性表格;
overflow-y: auto;
padding-left: 6px;
}

.添加组件事件 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
:shape="item.shape"
:size="item.size"
:theme="item.theme"
:variant="item.variant"
>{{ item.text }}</t-button>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import {ElMessage} from "element-plus";
const store = useAppStore()
const handleNodeClick = (data) => {
store.代码编辑框.路径 = data.path
//这里暂时不处理
return
store.代码编辑器.路径 = data.path
E读入文件(data.path ).then((res) => {
console.log(res)
store.代码编辑器.内容 = res
Expand Down
6 changes: 3 additions & 3 deletions GoEasyDesigner/frontend/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"debug_info": "Debugging information",
"design": "design",
"downloadClient": "Download Client",
"edit_code": "edit code",
"edit_code": "code",
"environmentCheck": "Environment Check",
"help": "Help",
"helpDesc": "Window projects need to be created manually.\n wails init -n \"go-easy-demo\" -t https://github.com/duolabmeng6/wails-template-vue-go-easy \n<br>\n\nOnly the design interface can be saved in the browser.\n\n<br>\n\nIt is recommended to use the client to save it more simply. At present, you still need to install the go and node environment by yourself.",
Expand All @@ -19,13 +19,13 @@
"new": "New",
"open": "Open",
"projectConfig": "Project Config",
"project_management": "project management",
"project_management": "project",
"run": "Run",
"save": "Save",
"selectImage": "select Image",
"stop": "stop",
"stopped": "stopped",
"support_library": "support library",
"support_library": "library",
"system_components": "system",
"td_components": "t design",
"updateCheck": "Update Check"
Expand Down
4 changes: 1 addition & 3 deletions GoEasyDesigner/frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,7 @@ function loadEidtCode() {

}

// if (store.客户端模式) {
loadEidtCode()
// }
loadEidtCode()


app.config.warnHandler = function (msg, vm, trace) {
Expand Down
32 changes: 28 additions & 4 deletions GoEasyDesigner/frontend/src/stores/appStore.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ref} from 'vue'
import {defineStore} from 'pinia'
import {WindowGetSize} from "../../wailsjs/runtime";
import {E保存, E发送跳转代码到ide, E文件枚举, E读入文件} from "../../wailsjs/go/main/App";
import {E发送跳转代码到ide, E文件枚举} from "../../wailsjs/go/main/App";
import {生成提示辅助代码} from "@/提示语法生成器.js";
import {窗口事件代码模板} from "@/编辑器/窗口事件代码模板.js";
import {ElMessage} from "element-plus";
Expand Down Expand Up @@ -61,7 +61,7 @@ export const useAppStore = defineStore('AppStore', {
是否为window系统: true,//github的文件信息
HistoryManager: HistoryManagerLiving,
putPosition: {},
rightClickMenus:ref({}),
rightClickMenus: ref({}),
}
},

Expand All @@ -71,6 +71,30 @@ export const useAppStore = defineStore('AppStore', {
if (this.代码编辑器.内容 == "") {
this.代码编辑器.内容 = 窗口事件代码模板
}
let rawName = item[`event_${事件名称}`]
if (rawName != undefined) {
let 跳转位置 = this.代码编辑器.内容.indexOf(rawName)
if (跳转位置 != -1) {

if (this.项目信息.窗口事件文件路径 == "") {
this.选择夹_中间现行选中项 = "1"
this.putPosition(rawName)
return
}

this.选择夹_中间现行选中项 = "1"
this.putPosition(rawName)
//已存在事件
console.log("跳转位置", 跳转位置)
E发送跳转代码到ide(
this.项目信息.IDE插件地址,
this.项目信息.窗口事件文件路径,
跳转位置
)
return
}
}

let code = `item.event_${事件名称} = "${函数名称}"`
eval(code)
let ncode = '';
Expand Down Expand Up @@ -243,7 +267,7 @@ export const useAppStore = defineStore('AppStore', {
id.forEach((v, i) => {
this.__递归删除id(源数据, v)
})
}else{
} else {
this.__递归删除id(源数据, id)
}
this.当前组件索引 = "1"
Expand Down Expand Up @@ -324,7 +348,7 @@ export const useAppStore = defineStore('AppStore', {
zIndex: 0,
占比: 8,
childComponents: [],
复制组件:[],
复制组件: [],
}
this.递归添加(this.list, 插入数据, id)
},
Expand Down

0 comments on commit b9569d8

Please sign in to comment.