Skip to content

Commit

Permalink
fix(formType-signature): fixed disabled status
Browse files Browse the repository at this point in the history
  • Loading branch information
Liberty-liu committed Sep 18, 2023
1 parent 7f3c51b commit 44fbb44
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
16 changes: 9 additions & 7 deletions packages/formEditor/components/FormTypes/Signature/mobile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Icon from '@ER/icon'
import utils from '@ER/utils'
import hooks from '@ER/hooks'
export default {
name: 'er-button',
name: 'er-signature',
inheritAttrs: false,
customOptions: {}
}
Expand Down Expand Up @@ -108,10 +108,6 @@ const handleAction = async (type) => {
<template
v-if="data.options.defaultValue"
>
<!-- <img-->
<!-- :src="data.options.defaultValue.url"-->
<!-- style="object-fit: contain; width: 100%; height: 100%;"-->
<!-- >-->
<van-image
width="100%"
height="100"
Expand All @@ -123,12 +119,18 @@ const handleAction = async (type) => {
v-else
:class="[ns.e('noData')]"
>
<el-button text type="primary" icon="Edit" circle>
<el-button
text
circle
type="primary"
icon="Edit"
:disabled="params.disabled"
>
{{t('er.form.addSignature')}}
</el-button>
</div>
</template>
<template v-if="data.options.defaultValue" #button>
<template v-if="data.options.defaultValue && !params.disabled" #button>
<van-icon @click.stop="data.options.defaultValue = ''" name="clear" />
</template>
</van-field>
Expand Down
18 changes: 15 additions & 3 deletions packages/formEditor/components/FormTypes/Signature/pc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Icon from '@ER/icon'
import utils from '@ER/utils'
import hooks from '@ER/hooks'
export default {
name: 'er-button',
name: 'er-signature',
inheritAttrs: false,
customOptions: {}
}
Expand Down Expand Up @@ -60,6 +60,7 @@ const handleOpen = () => {
})
}
const handleReOpen = () => {
if (props.params.disabled) return false
dialogVisible.value = true
showClear.value = false
changed.value = false
Expand Down Expand Up @@ -105,13 +106,24 @@ const handleCommit = async () => {
:fit="'contain'"
style="width: 100%; height: 100%;"
/>
<Icon @click="data.options.defaultValue = ''" :class="[ns.e('clear')]" icon="delete"></Icon>
<Icon
v-if="!params.disabled"
@click="data.options.defaultValue = ''"
:class="[ns.e('clear')]"
icon="delete"/>
</template>
<div
v-else
:class="[ns.e('noData')]"
>
<el-button @click="handleOpen" text type="primary" icon="Edit" circle>
<el-button
@click="handleOpen"
text
circle
type="primary"
icon="Edit"
:disabled="params.disabled"
>
{{ t('er.form.addSignature') }}
</el-button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/formEditor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ const getData2 = () => {
layout,
data: state.data,
config: state.config,
fields: fields,
fields,
logic: state.logic
})
}
Expand Down

0 comments on commit 44fbb44

Please sign in to comment.