Skip to content

Commit

Permalink
Merge pull request #24 from Liberty-liu/test/erFormConfig
Browse files Browse the repository at this point in the history
Test/erFormConfig
  • Loading branch information
Liberty-liu authored Aug 18, 2023
2 parents b23d24a + 14bd5f0 commit 18a0571
Show file tree
Hide file tree
Showing 9 changed files with 2,883 additions and 80 deletions.
3 changes: 1 addition & 2 deletions examples/views/formEditorConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ const sector = computed(() => {
} else {
result = _.find(all.value, { id: value0.value })
}
console.log(result?.columns?.[0])
return result?.columns?.[0] || result
return result
})
const handleListener = async ({ type, data }) => {
console.log(type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import utils from '@ER/utils'
import hooks from '@ER/hooks'
export default {
name: 'ConfigCheckboxComponent',
inheritAttrs: false,
customOptions: {}
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import hooks from '@ER/hooks'
import Icon from '@ER/icon'
export default {
name: 'ConfigCollapseComponent',
inheritAttrs: false,
customOptions: {}
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ClickOutside as vClickOutside } from 'element-plus'
import CompleteButton from '@ER/formEditor/components/CompleteButton.vue'
import PanelsConfigComponentsTypeComponent from './TypeComponent.vue'
import PanelsConfigComponentsLogicComponent from './LogicComponent.vue'
import utils from '@ER/utils'
export default {
name: 'GlobalConfigPanel',
inheritAttrs: false,
Expand Down Expand Up @@ -41,7 +42,6 @@ const popperPaneRef = computed(() => {
})
let handleConfirm = ''
const handleBeforeChange = () => {
// visible.value = true
return new Promise((resolve, reject) => {
const pcObj = _.pick(unref(target).pc, compareKeys)
const mobileObj = _.pick(unref(target).mobile, compareKeys)
Expand Down Expand Up @@ -86,10 +86,6 @@ const options0 = computed(() => {
}
]
})
// <el-radio-button label="large">{{t('er.config.globalConfig.componentSize.large')}}</el-radio-button>
// <el-radio-button label="default" >{{t('er.config.globalConfig.componentSize.default')}}</el-radio-button>
// <el-radio-button label="small" >{{t('er.config.globalConfig.componentSize.small')}}</el-radio-button>
const options1 = computed(() => {
return [
{
Expand Down Expand Up @@ -128,7 +124,7 @@ const handleTypeListener = ({ property, data }) => {
<div>
<div :class="[ns.e('syncContent')]">
<el-icon color="#f90">
<QuestionFilled />
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592 0-42.944-14.08-76.736-42.24-101.376-28.16-25.344-65.472-37.312-111.232-37.312zm-12.672 406.208a54.272 54.272 0 0 0-38.72 14.784 49.408 49.408 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.848 54.848 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.968 51.968 0 0 0-15.488-38.016 55.936 55.936 0 0 0-39.424-14.784z"></path></svg>
</el-icon>
{{ t('er.config.globalConfig.sync.warning') }}
</div>
Expand All @@ -152,8 +148,11 @@ const handleTypeListener = ({ property, data }) => {
</el-button>
</div>
</el-popover>
<!-- <DeviceSwitch justify-content="center"></DeviceSwitch>-->
<el-form-item :label="t('er.config.globalConfig.sync.label')" label-position="left">
<el-form-item
:label="t('er.config.globalConfig.sync.label')"
label-position="left"
v-bind="utils.addTestId('configPanel:isSync')"
>
<el-switch
ref="buttonRef"
v-click-outside:[popperPaneRef]="onClickOutside"
Expand All @@ -168,6 +167,7 @@ const handleTypeListener = ({ property, data }) => {
:label="t('er.config.globalConfig.componentSize.label')"
:val="target[state.platform].size"
:nodes="options1"
v-bind="utils.addTestId('configPanel:size')"
/>
<PanelsConfigComponentsTypeComponent
@listener="handleTypeListener"
Expand All @@ -177,8 +177,13 @@ const handleTypeListener = ({ property, data }) => {
:fontSize="80"
:val="target[state.platform].labelPosition"
:nodes="options0"
v-bind="utils.addTestId('configPanel:labelPosition')"
/>
<el-form-item v-if="ER.props.isShowCompleteButton" :label="t('er.public.button')">
<el-form-item
v-if="ER.props.isShowCompleteButton"
:label="t('er.public.button')"
v-bind="utils.addTestId('configPanel:completeButton')"
>
<div style="width: 100%;">
<div>
<CompleteButton mode="preview"/>
Expand Down
Loading

0 comments on commit 18a0571

Please sign in to comment.