mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-17 02:00:02 +08:00
style(editor): 统一代码列表与其他列表的搜索框
This commit is contained in:
parent
1b5d3e564d
commit
8aa2ecd9c8
@ -1,12 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<TMagicDialog
|
<TMagicDrawer
|
||||||
:model-value="true"
|
|
||||||
class="code-editor-dialog"
|
class="code-editor-dialog"
|
||||||
|
:model-value="true"
|
||||||
:title="currentTitle"
|
:title="currentTitle"
|
||||||
:fullscreen="true"
|
|
||||||
:close-on-press-escape="false"
|
:close-on-press-escape="false"
|
||||||
:append-to-body="true"
|
:append-to-body="true"
|
||||||
:show-close="false"
|
:show-close="false"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:size="size"
|
||||||
>
|
>
|
||||||
<Layout v-model:left="left" :min-left="45" class="code-editor-layout">
|
<Layout v-model:left="left" :min-left="45" class="code-editor-layout">
|
||||||
<!-- 右侧区域 -->
|
<!-- 右侧区域 -->
|
||||||
@ -26,14 +27,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Layout>
|
</Layout>
|
||||||
</TMagicDialog>
|
</TMagicDrawer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup name="MEditorCodeBlockEditor">
|
<script lang="ts" setup name="MEditorCodeBlockEditor">
|
||||||
import { computed, inject, reactive, ref, watchEffect } from 'vue';
|
import { computed, inject, reactive, ref, watchEffect } from 'vue';
|
||||||
import { cloneDeep, forIn, isEmpty } from 'lodash-es';
|
import { cloneDeep, forIn, isEmpty } from 'lodash-es';
|
||||||
|
|
||||||
import { TMagicDialog } from '@tmagic/design';
|
import { TMagicDrawer } from '@tmagic/design';
|
||||||
import { ColumnConfig } from '@tmagic/form';
|
import { ColumnConfig } from '@tmagic/form';
|
||||||
import { CodeBlockContent } from '@tmagic/schema';
|
import { CodeBlockContent } from '@tmagic/schema';
|
||||||
|
|
||||||
@ -49,6 +50,8 @@ defineProps<{
|
|||||||
paramsColConfig?: ColumnConfig;
|
paramsColConfig?: ColumnConfig;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
const size = computed(() => globalThis.document.body.clientWidth - (services?.uiService.get('columnWidth').left || 0));
|
||||||
|
|
||||||
const left = ref(200);
|
const left = ref(200);
|
||||||
const currentTitle = ref('');
|
const currentTitle = ref('');
|
||||||
// 编辑器当前需展示的代码块内容
|
// 编辑器当前需展示的代码块内容
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="m-editor-code-block-list">
|
<TMagicScrollbar class="m-editor-code-block-list">
|
||||||
<slot name="code-block-panel-header">
|
<slot name="code-block-panel-header">
|
||||||
<div class="code-header-wrapper">
|
<div class="code-header-wrapper">
|
||||||
<SearchInput @search="filterTextChangeHandler"></SearchInput>
|
<SearchInput @search="filterTextChangeHandler"></SearchInput>
|
||||||
@ -10,7 +10,6 @@
|
|||||||
</slot>
|
</slot>
|
||||||
|
|
||||||
<!-- 代码块列表 -->
|
<!-- 代码块列表 -->
|
||||||
<TMagicScrollbar>
|
|
||||||
<TMagicTree
|
<TMagicTree
|
||||||
ref="tree"
|
ref="tree"
|
||||||
class="magic-editor-layer-tree"
|
class="magic-editor-layer-tree"
|
||||||
@ -41,7 +40,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</TMagicTree>
|
</TMagicTree>
|
||||||
</TMagicScrollbar>
|
|
||||||
|
|
||||||
<!-- 代码块编辑区 -->
|
<!-- 代码块编辑区 -->
|
||||||
<CodeBlockEditor v-if="isShowCodeBlockEditor" :paramsColConfig="paramsColConfig">
|
<CodeBlockEditor v-if="isShowCodeBlockEditor" :paramsColConfig="paramsColConfig">
|
||||||
@ -49,7 +47,7 @@
|
|||||||
<slot name="code-block-edit-panel-header" :id="id"></slot>
|
<slot name="code-block-edit-panel-header" :id="id"></slot>
|
||||||
</template>
|
</template>
|
||||||
</CodeBlockEditor>
|
</CodeBlockEditor>
|
||||||
</div>
|
</TMagicScrollbar>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="MEditorCodeBlockList">
|
<script setup lang="ts" name="MEditorCodeBlockList">
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
.m-editor-code-block-list {
|
.m-editor-code-block-list {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin-top: 48px;
|
|
||||||
|
.magic-editor-layer-tree {
|
||||||
|
padding-top: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
.code-header-wrapper {
|
.code-header-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -8,6 +12,7 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
.search-input {
|
.search-input {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user