Skip to content

Commit

Permalink
perf: save a temporary code
Browse files Browse the repository at this point in the history
  • Loading branch information
Liberty-liu committed Mar 27, 2023
1 parent 1122124 commit 665e216
Show file tree
Hide file tree
Showing 96 changed files with 388 additions and 341 deletions.
31 changes: 18 additions & 13 deletions examples/views/formEditor/objEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,25 @@ const getObjData = async () => {
}
}
const handleListener = async ({ type, data }) => {
if (type === 'getData') {
loading.value = true
try {
const postData = {
name: state.name,
content: data
switch (type) {
case 'lang':
lang.value = data
break
case 'getData':
loading.value = true
try {
const postData = {
name: state.name,
content: data
}
await hooks.useFetch(`${uri.obj}/${route.params.objid}`, {
method: 'put',
data: postData
})
} finally {
loading.value = false
}
await hooks.useFetch(`${uri.obj}/${route.params.objid}`, {
method: 'put',
data: postData
})
} finally {
loading.value = false
}
break
}
}
onMounted(() => {
Expand Down
3 changes: 2 additions & 1 deletion examples/views/formEditorConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ layoutNodes.forEach((node, index) => {
})
const all = [...store.fields, ...store.layouts]
// const value0 = ref('root')
const value0 = ref(store.layouts[2].id)
// const value0 = ref(store.layouts[0].id)
const value0 = ref(store.fields[5].id)
const sector = computed(() => {
let result = ''
if (value0.value === 'root') {
Expand Down
20 changes: 9 additions & 11 deletions packages/formEditor/components/DeviceSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ export default {
}
</script>
<script setup>
const props = defineProps({
justifyContent: {
type: String,
required: true
}
})
// const props = defineProps({
// justifyContent: {
// type: String,
// required: true
// }
// })
const ER = inject('Everright')
const ns = hooks.useNamespace('DeviceSwitch')
const {
Expand All @@ -24,11 +24,9 @@ const element = ref('')
// })
</script>
<template>
<div :class="[ns.b()]" :style="{ justifyContent: justifyContent}">
<div>
<Icon @click="() => ER.switchPlatform('pc')" icon="pc" :class="[ns.e('icon'), state.platform === 'pc' && 'active']"></Icon>
<Icon @click="() => ER.switchPlatform('mobile')" icon="iphone" :class="[ns.e('icon'), state.platform === 'mobile' && 'active']"></Icon>
</div>
<div :class="[ns.b()]">
<Icon @click="() => ER.switchPlatform('pc')" icon="PC" :class="[ns.e('icon'), state.platform === 'pc' && 'active']"></Icon>
<Icon @click="() => ER.switchPlatform('mobile')" icon="cellphone" :class="[ns.e('icon'), state.platform === 'mobile' && 'active']"></Icon>
</div>
</template>

Expand Down
1 change: 0 additions & 1 deletion packages/formEditor/components/Panels/Blocks/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { dragGableWrap } from '@ER/formEditor/components/Layout/DragGable.jsx'
import { inject, ref, reactive, nextTick } from 'vue'
import _ from 'lodash-es'
import Icon from '@ER/icon'
import DeviceSwitch from '@ER/formEditor/components/DeviceSwitch.vue'
import ControlInsertionPlugin from '../../Layout/ControlInsertionPlugin.js'
import { nanoid } from 'nanoid'
export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@ const props = defineProps({
</script>
<template>
<div>
<!-- <span class="subhead">{{t('er.public.unit')}}:px</span>-->
<div :class="[ns.b()]">
<el-row :gutter="14" justify="center">
<el-col :span="12">
<el-input-number
:step="10"
:min="props.min"
size="large"
v-model="target.style[props.field].left"
controls-position="right"
/>
Expand All @@ -44,7 +42,6 @@ const props = defineProps({
<el-input-number
:step="10"
:min="props.min"
size="large"
v-model="target.style[props.field].top"
controls-position="right"
/>
Expand All @@ -55,7 +52,6 @@ const props = defineProps({
<el-input-number
:step="10"
:min="props.min"
size="large"
v-model="target.style[props.field].right"
controls-position="right"
/>
Expand All @@ -64,57 +60,11 @@ const props = defineProps({
<el-input-number
:step="10"
:min="props.min"
size="large"
v-model="target.style[props.field].bottom"
controls-position="right"
/>
</el-col>
</el-row>
</div>
</div>
<!-- <el-form-item size="default" :label="t(`er.public.${props.field}`)">-->
<!-- <span class="subhead">{{t('er.public.unit')}}:px</span>-->
<!-- <div :class="[ns.b()]">-->
<!-- <el-row :gutter="14" justify="center">-->
<!-- <el-col :span="12">-->
<!-- <el-input-number-->
<!-- :step="10"-->
<!-- :min="props.min"-->
<!-- size="large"-->
<!-- v-model="target.style[props.field].left"-->
<!-- controls-position="right"-->
<!-- />-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-input-number-->
<!-- :step="10"-->
<!-- :min="props.min"-->
<!-- size="large"-->
<!-- v-model="target.style[props.field].top"-->
<!-- controls-position="right"-->
<!-- />-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row :gutter="14" justify="center">-->
<!-- <el-col :span="12">-->
<!-- <el-input-number-->
<!-- :step="10"-->
<!-- :min="props.min"-->
<!-- size="large"-->
<!-- v-model="target.style[props.field].right"-->
<!-- controls-position="right"-->
<!-- />-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-input-number-->
<!-- :step="10"-->
<!-- :min="props.min"-->
<!-- size="large"-->
<!-- v-model="target.style[props.field].bottom"-->
<!-- controls-position="right"-->
<!-- />-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </div>-->
<!-- </el-form-item>-->
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ const handleSuccess = (response, uploadFile) => {
<!-- <div v-if="!state.value0" :class="[target.style.isCustomBackground && ns.e('selecteColor')]">-->
<div v-if="!state.value0">
<el-color-picker
size="large"
@active-change="handleActiveChange"
@change="handleChange"
v-model="target.style.background.color"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ const handleTypeListener = ({ property, data }) => {
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item :label="t('er.public.width')">
<el-form-item>
<template v-slot:label>
<Icon icon="lineThickness"/>
</template>
<el-input-number
:step="1"
:min="0"
Expand All @@ -127,7 +130,10 @@ const handleTypeListener = ({ property, data }) => {
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item :label="t('er.public.radius')">
<el-form-item>
<template v-slot:label>
<Icon icon="radius"/>
</template>
<el-input-number
:step="1"
:min="0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,26 @@ const props = defineProps({
label: {
type: String,
required: true
},
mode: {
type: Number,
default: 1
}
// mode: {
// type: Number,
// default: 1
// }
})
</script>
<template>
<div :class="[ns.b(), target.options[field] && ns.e('open')]">
<el-checkbox v-model="target.options[field]" @change="(newValue) => $emit('change', newValue)" :label="label" size="large"></el-checkbox>
<template v-if="mode === 1">
<template v-if="$slots.default">
<div :class="[ns.e('slot')]" v-show="target.options[field]"><slot></slot></div>
</template>
</template>
<template v-else>
<div :class="[ns.e('slot')]"><slot></slot></div>
<template v-if="$slots.default">
<div :class="[ns.e('slot')]" v-show="target.options[field]"><slot></slot></div>
</template>
<!-- <template v-if="mode === 1">-->
<!-- <template v-if="$slots.default">-->
<!-- <div :class="[ns.e('slot')]" v-show="target.options[field]"><slot></slot></div>-->
<!-- </template>-->
<!-- </template>-->
<!-- <template v-else>-->
<!-- <div :class="[ns.e('slot')]"><slot></slot></div>-->
<!-- </template>-->
</div>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const handleAction = (type) => {
v-model="element.label"/>
<div :class="ns.e('operate')">
<Icon :class="[ns.e('icon')]" @click="target.columns.splice(index, 1)" icon="delete"></Icon>
<Icon :class="[ns.e('icon'), 'handle']" icon="move"></Icon>
<Icon :class="[ns.e('icon'), 'handle']" icon="Rank"></Icon>
</div>
</li>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const handleClick = (type) => {
</el-button>
</div>
</el-popover>
<DeviceSwitch justify-content="center"></DeviceSwitch>
<!-- <DeviceSwitch justify-content="center"></DeviceSwitch>-->
<el-form-item :label="t('er.config.globalConfig.sync.label')" label-position="left">
<el-switch
ref="buttonRef"
Expand Down
Loading

0 comments on commit 665e216

Please sign in to comment.