[web] fix editor bugs

This commit is contained in:
zhangyang 2023-03-12 22:24:34 +08:00
parent 2d1c565ddb
commit 97ab813ccb
3 changed files with 27334 additions and 5 deletions

27319
core/datacap-web/console-fe/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,7 @@ export class HttpCommon
{
if (process.env.NODE_ENV === 'development' ||
window.location.hostname === 'localhost') {
axios.defaults.baseURL = 'http://localhost:9096';
axios.defaults.baseURL = 'http://139.198.158.103:9096';
}
else {
axios.defaults.baseURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');

View File

@ -62,11 +62,11 @@
<Button @click="handlerPlusEditor" size="small" type="primary" icon="md-add"/>
</template>
<TabPane v-for="editor in editors" :key="editor.key" :name="editor.key" :label="editor.title" :closable="editor.closable">
<MonacoEditor theme="vs" :options="{theme: 'vs-dark', fontSize: 15}" language="sql" :height="300"
:key="activeKey.value" @change="handlerChangeEditorValue"
v-model:value="activeEditorValue" @editorDidMount="handlerEditorDidMount($event, 'mysql')">
</MonacoEditor>
</TabPane>
<MonacoEditor theme="vs" :options="{theme: 'vs-dark', fontSize: 15}" language="sql" :height="300"
:key="activeKey.value" @change="handlerChangeEditorValue" :width="'100%'"
v-model:value="activeEditorValue" @editorDidMount="handlerEditorDidMount($event, 'mysql')">
</MonacoEditor>
</Tabs>
</div>
</Card>
@ -147,6 +147,13 @@ export default defineComponent({
{
this.handlerInitialize();
},
mounted(){
window.onresize=()=>{
if(editorMap.values().next().value){
editorMap.values().next().value.layout({width: this.$refs.editorContainer.offsetWidth,height:300})
}
}
},
methods: {
handlerInitialize()
{
@ -229,6 +236,9 @@ export default defineComponent({
});
}
});
setTimeout(()=>{
editorMap.values().next().value?.layout({width: this.$refs.editorContainer.offsetWidth,height:300})
},200)
},
handlerRun()
{