Browse Source

优化可拖动范围

mxd 3 years ago
parent
commit
72a5a4b66d

+ 2 - 1
src/components/common/magic-resizer.vue

@@ -10,6 +10,7 @@ export default {
     props: {
         max: Number,
         min: Number,
+        value: Number,
         direction: String,
         reverse: {
             type: Boolean,
@@ -18,7 +19,7 @@ export default {
     },
     setup(props){
         const style = ref({
-            [props.direction === 'x' ? 'width' : 'height']: props.min + 'px'
+            [props.direction === 'x' ? 'width' : 'height']: (props.value || props.min) + 'px'
         })
         return {
             style

+ 1 - 1
src/components/panel/footer/magic-toolbar.vue

@@ -2,7 +2,7 @@
     <div class="magic-toolbar">
         <magic-navbar direction="horizontal" ref="navbar">
             <magic-navbar-item v-for="(toolbar, key) in toolbars" :key="key" v-bind="toolbar">
-                <magic-resizer direction="y" :max="600" :min="250" >
+                <magic-resizer direction="y" :max="700" :min="150"  :value="250">
                     <div class="magic-toolbar-header">
                         <label>{{ toolbar.title }}</label>
                         <div class="magic-toolbar-header-buttons">

+ 6 - 1
src/components/panel/main/magic-data-resource.vue

@@ -8,7 +8,7 @@
 					</li>
 				</template>
 			</ul>
-			<magic-input v-model:value="keyword" :placeholder="$i('message.searchText')" width="auto"/>
+			<magic-input v-model:value="keyword" :placeholder="$i('message.searchText')" width="100%"/>
 			<magic-icon icon="search" size="14px"/>
 		</div>
 		<magic-empty v-if="datasources.length === 0" :text="$i('message.empty', title)"/>
@@ -234,9 +234,14 @@ const onContextMenu = (item, event) => {
 .magic-data-resource .magic-data-resource-header svg{
 	height: 100%;
 }
+.magic-data-resource > ul{
+	height: 100%;
+	overflow: auto;
+}
 .magic-data-resource > ul li{
 	line-height: 22px;
 	padding-left: 10px;
+	white-space: nowrap;
 }
 .magic-data-resource > ul li:hover{
 	background-color: var(--tree-hover-background-color);

+ 2 - 2
src/components/panel/main/magic-main.vue

@@ -3,7 +3,7 @@
 		<!-- 左侧导航条 -->
 		<magic-navbar direction="vertical" :to="$refs.mrl" v-if="nextRender" ref="mnl" :spliter="true">
 			<magic-navbar-item v-for="(navbar, index) in leftNavbars" :key="index" v-bind="navbar">
-				<magic-resizer :max="600" :min="370" direction='x'>
+				<magic-resizer :max="750" :min="270" direction='x'>
 					<magic-loading :loading="loading">
 						<magic-resource v-bind="navbar" :data="resources[navbar.type]" @close="$refs.mnl.select(-1)" @onLoad="resourceOnLoad"/>
 					</magic-loading>
@@ -22,7 +22,7 @@
 		<!-- 右侧导航条 -->
 		<magic-navbar  :reverse="true" :default-select="-1" direction="vertical" :to="$refs.mrr" :spliter="true">
 			<magic-navbar-item v-for="(navbar, index) in rightNavbars" :key="index" :title="navbar.title" :icon="navbar.icon">
-				<magic-resizer :max="320" :min="240" direction='x' :reverse="true" v-if="nextRender">
+				<magic-resizer :max="420" :min="140" direction='x' :reverse="true" v-if="nextRender">
 					<magic-loading :loading="loading">
 						<magic-data-resource  :type="navbar.type" :title="navbar.name" :data="resources[navbar.type]"/>
 					</magic-loading>

+ 1 - 1
src/components/panel/main/magic-resource.vue

@@ -2,7 +2,7 @@
 	<div class="magic-resource" @contextmenu.prevent="e => displayBlankContextMenu(e)">
 		<div class="magic-resource-header">
 			<magic-icon icon="search" size="14px"/>
-			<magic-input v-model:value="keyword" :placeholder="$i('message.searchText')" width="auto"/>
+			<magic-input v-model:value="keyword" :placeholder="$i('message.searchText')" width="100%"/>
 			<ul>
 				<template v-for="(button, index) in buttons" :key="index" >
 					<li v-if="!button.show || button.show()" :title="button.name || ''" @click="button.onClick&&button.onClick()" :class="{ separator: button.separator}">