From e2a625ba1290e47f3de796c59552369be6bdaa36 Mon Sep 17 00:00:00 2001 From: Mouriya Date: Mon, 17 Jun 2024 03:16:26 +0900 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=8A=9B=E3=83=9C=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=82=B9=E3=81=AE=E5=85=A5=E5=8A=9B=E5=8F=AF=E5=90=A6=E3=81=AE?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=82=92=E5=89=8A=E9=99=A4=E3=81=97=E3=80=81?= =?UTF-8?q?=E7=89=B9=E5=AE=9A=E3=81=AE=E3=83=9C=E3=82=BF=E3=83=B3=E5=85=A5?= =?UTF-8?q?=E5=8A=9B=E5=BE=8C=E3=81=AB=E5=85=A5=E5=8A=9B=E3=83=9C=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=82=B9=E3=81=AE=E5=85=A5=E5=8A=9B=E5=8F=AF=E5=90=A6?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=99=E3=82=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DynamicItemInput/DynamicItemInput.vue | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/DynamicItemInput/DynamicItemInput.vue b/frontend/src/components/DynamicItemInput/DynamicItemInput.vue index 29165de..0b77a2b 100644 --- a/frontend/src/components/DynamicItemInput/DynamicItemInput.vue +++ b/frontend/src/components/DynamicItemInput/DynamicItemInput.vue @@ -44,6 +44,7 @@ type ButtonConfig = { label: string; color: string; type: string; + editable: boolean; }; export default defineComponent({ @@ -55,10 +56,10 @@ export default defineComponent({ ShowDialog }, props: { - canInput: { - type: Boolean, - default: false - }, + // canInput: { + // type: Boolean, + // default: false + // }, appId: { type: String, }, @@ -79,11 +80,14 @@ export default defineComponent({ const currentComponent = ref('FieldAdd'); const sharedText = ref(props.selectedObject?.sharedText ?? ''); const inputRef = ref(); + const canInput = ref(true); + const editable = ref(false); const openDialog = (button: ButtonConfig) => { currentDialogName.value = button.label; currentComponent.value = button.type; dialogVisible.value = true; + editable.value = button.editable ?? true; }; const closeDialog = () => { @@ -100,20 +104,22 @@ export default defineComponent({ // const textAfter = sharedText.value.substring(cursorPosition); // sharedText.value = `${textBefore}${value._t}${textAfter}`; // } - + + if (value && value._t && (value._t as string).length > 0) { + canInput.value = editable.value; + } emit('update:selectedObject', { sharedText: sharedText.value, ...value }); dialogVisible.value = false; }; const clearSharedText = () => { sharedText.value = ''; + canInput.value = true; emit('update:selectedObject', {}); } const updateSharedText = (value) => { sharedText.value = value; - emit('update:selectedObject', { ...props.selectedObject, sharedText: value }); - console.log(props.selectedObject); } return { @@ -121,6 +127,7 @@ export default defineComponent({ dialogVisible, currentDialogName, currentComponent, + canInput, openDialog, closeDialog, handleSelect,