mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: 读写插件增加交互方式
This commit is contained in:
parent
f0abac8671
commit
af598613b7
|
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<div class="cursor w-full">
|
||||
<slot name="read">
|
||||
<div class="flex align-center" v-if="!isEdit">
|
||||
<div class="flex align-center" v-if="!isEdit" @dblclick="dblclick">
|
||||
<auto-tooltip :content="data">
|
||||
{{ data }}
|
||||
</auto-tooltip>
|
||||
|
||||
<el-button class="ml-4" @click.stop="editNameHandle" text v-if="showEditIcon">
|
||||
<el-button v-if="!trigger && showEditIcon" class="ml-4" @click.stop="editNameHandle" text>
|
||||
<el-icon><EditPen /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
|
|
@ -56,6 +56,11 @@ const props = defineProps({
|
|||
maxlength: {
|
||||
type: Number,
|
||||
default: () => 0
|
||||
},
|
||||
trigger: {
|
||||
type: String,
|
||||
default: '',
|
||||
validator: (value: string) => ['dblclick'].includes(value)
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['change'])
|
||||
|
|
@ -74,6 +79,12 @@ watch(isEdit, (bool) => {
|
|||
}
|
||||
})
|
||||
|
||||
function dblclick() {
|
||||
if (props.trigger === 'dblclick') {
|
||||
editNameHandle()
|
||||
}
|
||||
}
|
||||
|
||||
function submit() {
|
||||
loading.value = true
|
||||
emit('change', writeValue.value)
|
||||
|
|
|
|||
|
|
@ -203,10 +203,7 @@ function getApplication() {
|
|||
})
|
||||
}
|
||||
function refresh() {
|
||||
if (isApplication.value) {
|
||||
common.saveBreadcrumb(null)
|
||||
getApplication()
|
||||
}
|
||||
common.saveBreadcrumb(null)
|
||||
}
|
||||
onMounted(() => {
|
||||
if (!breadcrumbData.value) {
|
||||
|
|
|
|||
|
|
@ -9,11 +9,7 @@
|
|||
<div class="flex-between mb-16">
|
||||
<div class="flex align-center">
|
||||
<component :is="iconComponent(`${nodeModel.type}-icon`)" class="mr-8" :size="24" />
|
||||
<h4
|
||||
@mouseenter="showEditIcon = true"
|
||||
@mouseleave="showEditIcon = false"
|
||||
v-if="showOperate(nodeModel.type)"
|
||||
>
|
||||
<h4 v-if="showOperate(nodeModel.type)">
|
||||
<ReadWrite
|
||||
@mousemove.stop
|
||||
@mousedown.stop
|
||||
|
|
@ -21,7 +17,7 @@
|
|||
@click.stop
|
||||
@change="editName"
|
||||
:data="nodeModel.properties.stepName"
|
||||
:showEditIcon="showEditIcon"
|
||||
trigger="dblclick"
|
||||
/>
|
||||
</h4>
|
||||
<h4 v-else>{{ nodeModel.properties.stepName }}</h4>
|
||||
|
|
|
|||
Loading…
Reference in New Issue