-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from Liberty-liu/feat/exportForm
Feat/added an "other" option
- Loading branch information
Showing
26 changed files
with
336 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<script> | ||
import hooks from '@ER/hooks' | ||
import { ref, watch, inject, computed } from 'vue' | ||
import _ from 'lodash-es' | ||
export default { | ||
name: 'er-other', | ||
inheritAttrs: false, | ||
customOptions: {} | ||
} | ||
</script> | ||
<script setup> | ||
const ER = inject('Everright') | ||
const ns = hooks.useNamespace('FormTypesOther_mobile') | ||
const props = defineProps(['data', 'params']) | ||
const isShow = ref(false) | ||
const key = props.data.key + '_other' | ||
const value = computed({ | ||
set (newVal) { | ||
ER.state.othersFiles[key] = newVal | ||
}, | ||
get () { | ||
return ER.state.othersFiles[key] || '' | ||
} | ||
}) | ||
watch(() => props.data.options.defaultValue, (newVal) => { | ||
isShow.value = (_.isArray(newVal) ? newVal : [newVal]).includes('other') | ||
}, { | ||
immediate: true | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div | ||
v-if="isShow" | ||
:class="[ns.b()]"> | ||
<van-field | ||
v-model="value" | ||
:clearable="true" | ||
type="textarea" | ||
:placeholder="data.options.otherPlaceholder" | ||
/> | ||
</div> | ||
<!--<div--> | ||
<!-- v-if="isShow"--> | ||
<!-- :class="[ns.b()]">--> | ||
<!-- <el-input--> | ||
<!-- v-model="data.options.defaultValue"--> | ||
<!-- type="textarea"--> | ||
<!-- placeholder="Please input"--> | ||
<!-- :rows="2"--> | ||
<!-- v-bind="params"/>--> | ||
<!--</div>--> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<script> | ||
import hooks from '@ER/hooks' | ||
import { ref, watch, inject, computed } from 'vue' | ||
import _ from 'lodash-es' | ||
export default { | ||
name: 'er-other', | ||
inheritAttrs: false, | ||
customOptions: {} | ||
} | ||
</script> | ||
<script setup> | ||
const ER = inject('Everright') | ||
const ns = hooks.useNamespace('FormTypesOther_pc') | ||
const props = defineProps(['data', 'params']) | ||
const key = props.data.key + '_other' | ||
const value = computed({ | ||
set (newVal) { | ||
ER.state.othersFiles[key] = newVal | ||
}, | ||
get () { | ||
return ER.state.othersFiles[key] || '' | ||
} | ||
}) | ||
const isShow = ref(false) | ||
watch(() => props.data.options.defaultValue, (newVal) => { | ||
isShow.value = (_.isArray(newVal) ? newVal : [newVal]).includes('other') | ||
}, { | ||
immediate: true | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div | ||
v-if="isShow" | ||
:class="[ns.b()]"> | ||
<el-input | ||
v-model="value" | ||
type="textarea" | ||
:placeholder="data.options.otherPlaceholder" | ||
:rows="2"/> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.