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