|
@@ -121,7 +121,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="content-block">
|
|
<div class="content-block">
|
|
<h2>{{ $t('rightPanel.defaultValue') }}</h2>
|
|
<h2>{{ $t('rightPanel.defaultValue') }}</h2>
|
|
- <textarea name="default-value" id="default-value" rows="3" v-model="property.contents"></textarea>
|
|
|
|
|
|
+ <textarea name="default-value" id="default-value" rows="3" v-model="property.contents" @blur="handleProperty('contents')"></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="content-block">
|
|
<div class="content-block">
|
|
<div class="check-box" @click="property.isMultiLine = !property.isMultiLine">
|
|
<div class="check-box" @click="property.isMultiLine = !property.isMultiLine">
|
|
@@ -257,35 +257,41 @@
|
|
let isOneCheckbox = ref(true)
|
|
let isOneCheckbox = ref(true)
|
|
|
|
|
|
const handleProperty = (key) => {
|
|
const handleProperty = (key) => {
|
|
- if (key === 'fieldName') {
|
|
|
|
- useDocument.setPropertyPanel({ 'fieldName': property.fieldName })
|
|
|
|
- }
|
|
|
|
- if (key === 'title') {
|
|
|
|
- useDocument.setPropertyPanel({ 'title': property.title })
|
|
|
|
- }
|
|
|
|
- if (key === 'destPage') {
|
|
|
|
- const destPageValue = property.destPage
|
|
|
|
- if (destPageValue !== '' && destPageValue != oldDestPage) {
|
|
|
|
- useDocument.setPropertyPanel({
|
|
|
|
- actionType: 1,
|
|
|
|
- destPage: destPageValue.toString()
|
|
|
|
- })
|
|
|
|
- oldDestPage = destPageValue
|
|
|
|
- }
|
|
|
|
- } else if (key === 'url') {
|
|
|
|
- let urlValue = property.url
|
|
|
|
- if (urlValue !== '') {
|
|
|
|
- if (!urlValue.startsWith('http://') && !urlValue.startsWith('https://')) {
|
|
|
|
- urlValue = 'https://' + urlValue
|
|
|
|
|
|
+ switch (key) {
|
|
|
|
+ case 'fieldName':
|
|
|
|
+ useDocument.setPropertyPanel({ 'fieldName': property.fieldName })
|
|
|
|
+ break
|
|
|
|
+ case 'title':
|
|
|
|
+ useDocument.setPropertyPanel({ 'title': property.title })
|
|
|
|
+ break
|
|
|
|
+ case 'destPage':
|
|
|
|
+ const destPageValue = property.destPage
|
|
|
|
+ if (destPageValue !== '' && destPageValue != oldDestPage) {
|
|
|
|
+ useDocument.setPropertyPanel({
|
|
|
|
+ actionType: 1,
|
|
|
|
+ destPage: destPageValue.toString()
|
|
|
|
+ })
|
|
|
|
+ oldDestPage = destPageValue
|
|
}
|
|
}
|
|
- useDocument.setPropertyPanel({
|
|
|
|
- url: urlValue,
|
|
|
|
- actionType: 6
|
|
|
|
- })
|
|
|
|
- oldUrl = urlValue
|
|
|
|
- } else {
|
|
|
|
- property.url = oldUrl
|
|
|
|
- }
|
|
|
|
|
|
+ break
|
|
|
|
+ case 'url':
|
|
|
|
+ let urlValue = property.url
|
|
|
|
+ if (urlValue !== '') {
|
|
|
|
+ if (!urlValue.startsWith('http://') && !urlValue.startsWith('https://')) {
|
|
|
|
+ urlValue = 'https://' + urlValue
|
|
|
|
+ }
|
|
|
|
+ useDocument.setPropertyPanel({
|
|
|
|
+ url: urlValue,
|
|
|
|
+ actionType: 6
|
|
|
|
+ })
|
|
|
|
+ oldUrl = urlValue
|
|
|
|
+ } else {
|
|
|
|
+ property.url = oldUrl
|
|
|
|
+ }
|
|
|
|
+ break
|
|
|
|
+ case 'contents':
|
|
|
|
+ useDocument.setPropertyPanel({ 'contents': property.contents })
|
|
|
|
+ break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -323,14 +329,7 @@
|
|
watch(() => property.textAlignment, (newValue, oldValue) => {
|
|
watch(() => property.textAlignment, (newValue, oldValue) => {
|
|
useDocument.setPropertyPanel({'textAlignment': newValue})
|
|
useDocument.setPropertyPanel({'textAlignment': newValue})
|
|
})
|
|
})
|
|
-
|
|
|
|
- watch(() => property.contents, (newValue, oldValue) => {
|
|
|
|
- if (newValue === '') {
|
|
|
|
- newValue = ' '
|
|
|
|
- }
|
|
|
|
- useDocument.setPropertyPanel({'contents': newValue})
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
|
|
+
|
|
watch(() => property.isMultiLine, (newValue, oldValue) => {
|
|
watch(() => property.isMultiLine, (newValue, oldValue) => {
|
|
useDocument.setPropertyPanel({'isMultiLine': newValue})
|
|
useDocument.setPropertyPanel({'isMultiLine': newValue})
|
|
})
|
|
})
|