Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(formType-signature): fixed disabled status #26

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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