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 25, 2023
1 parent f9b2f3c commit ee24a8e
Show file tree
Hide file tree
Showing 68 changed files with 1,494 additions and 1,262 deletions.
5 changes: 5 additions & 0 deletions examples/router.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as VueRouter from 'vue-router'
import demo from './views/demo.vue'
import FormEditorView from './views/formEditor.vue'
import FormEditorConfigView from './views/formEditorConfig.vue'
import FormEditorObjListView from './views/formEditor/objList.vue'
Expand All @@ -9,6 +10,10 @@ const routes = [
path: '/',
redirect: '/formEditor'
},
{
path: '/demo',
component: demo
},
{
path: '/formEditor',
component: FormEditorView
Expand Down
13 changes: 13 additions & 0 deletions examples/views/demo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script setup>
// import icon from '@ER/icon/svg/上一步precious-撤销undo.svg'
import Icon from '@ER/icon'
</script>
<template>
123
<!-- <icon></icon>-->
<!-- <Icon icon="Cellphone"></Icon>-->
<img src="/uploads/bo3G_S0x3pbJKnXh98X6II3p.png" alt="">
</template>
<style scoped>
</style>
15 changes: 10 additions & 5 deletions examples/views/formEditorConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
import _ from 'lodash-es'
import { ref, onMounted, getCurrentInstance, reactive, computed } from 'vue'
import { erFormConfig, erGeneratorData, erComponentsConfig, utils } from '@ER/formEditor'
console.log(erComponentsConfig)
const EReditorRef = ref(null)
const layoutNodes = erComponentsConfig.fieldConfig[1].list.map(e => erGeneratorData(e, false, 'zh-cn'))
const layoutNodes = erComponentsConfig.fieldConfig[2].list.map(e => erGeneratorData(e, false, 'zh-cn'))
const store = reactive({
fields: erComponentsConfig.fieldConfig[0].list.map(e => erGeneratorData(e, false, 'zh-cn')),
fields: [...erComponentsConfig.fieldConfig[0].list, ...erComponentsConfig.fieldConfig[1].list].map(e => erGeneratorData(e, false, 'zh-cn')),
layouts: []
})
const fieldData = ref({})
Expand All @@ -24,8 +26,9 @@ layoutNodes.forEach((node, index) => {
break
}
})
console.log(store)
const all = [...store.fields, ...store.layouts]
const value0 = ref(store.fields[9].id)
const value0 = ref(store.layouts[2].id)
const sector = computed(() => {
let result = ''
if (value0.value === 'root') {
Expand Down Expand Up @@ -62,7 +65,7 @@ const handleListener = async ({ type, data }) => {
</div>
</el-header>
<el-container>
<el-aside width="300px">
<el-aside width="340px">
<div class="customConfig">
<er-form-config
@listener="handleListener"
Expand All @@ -84,7 +87,9 @@ const handleListener = async ({ type, data }) => {
</template>
<style scoped lang="scss">
.customConfig {
::v-deep .Everright-formEditor-Config > form {
padding: 10px;
::v-deep .Everright-formEditor-Config {
width: 100%;
//height: 600px;
}
}
Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
"prepare": "husky install"
},
"dependencies": {
"element-plus": "^2.2.28",
"vant": "^4.0.8",
"vue": "^3.2.45",
"@vant/area-data": "^1.4.0",
"@vant/touch-emulator": "^1.4.0",
"@vue/shared": "^3.2.45",
Expand All @@ -40,17 +37,19 @@
"async": "^3.2.4",
"axios": "^1.2.2",
"dayjs": "^1.11.7",
"element-plus": "^2.2.28",
"jss": "^10.9.2",
"jss-preset-default": "^10.9.2",
"lodash-es": "^4.17.21",
"nanoid": "^4.0.0",
"nzh": "^1.0.8",
"signature_pad": "^4.1.4",
"vant": "^4.0.8",
"vite-svg-loader": "^4.0.0",
"vue": "^3.2.45",
"vuedraggable": "^4.1.0"
},
"devDependencies": {
"vue-router": "^4.1.6",
"express": "^4.18.2",
"@babel/core": "^7.21.0",
"@babel/eslint-parser": "^7.19.1",
"@ckeditor/ckeditor5-alignment": "^35.4.0",
Expand All @@ -63,6 +62,7 @@
"@element-plus/icons-vue": "^2.0.10",
"@vitejs/plugin-vue": "^3.2.0",
"@vitejs/plugin-vue-jsx": "^2.1.1",
"@vue/compiler-sfc": "^3.2.47",
"better-sqlite3": "^8.2.0",
"clipboard": "^2.0.11",
"connect-multiparty": "^2.2.0",
Expand All @@ -73,12 +73,14 @@
"eslint-plugin-n": "^15.6.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-vue": "^9.9.0",
"express": "^4.18.2",
"husky": "^8.0.3",
"lint-staged": "^13.1.2",
"nodemon": "^2.0.21",
"sass": "^1.58.3",
"vite": "^3.2.5",
"vite-plugin-eslint": "^1.8.1"
"vite-plugin-eslint": "^1.8.1",
"vue-router": "^4.1.6"
},
"lint-staged": {
"*.{vue,js,jsx}": "eslint"
Expand Down
6 changes: 3 additions & 3 deletions packages/formEditor/components/Panels/Blocks/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default {
return (
<li onClick={() => addStore(element)}>
<Icon class={[ns.e('icon')]} icon={element.icon}></Icon>
{utils.fieldLabel(t, element)}
<span>{utils.fieldLabel(t, element)}</span>
</li>
)
}
Expand All @@ -105,7 +105,7 @@ export default {
<ElAside class={[ns.b()]} width={ER.props.blockPanelWidth}>
<el-scrollbar>
<el-menu
default-openeds={['0', '1']}>
default-openeds={['0', '1', '2']}>
{state.blocks.map((element, index) => {
return (
<el-sub-menu
Expand Down Expand Up @@ -140,7 +140,7 @@ export default {
})}
</el-menu>
</el-scrollbar>
<DeviceSwitch justifyContent={'flex-end'}></DeviceSwitch>
{/* <DeviceSwitch justifyContent={'flex-end'}></DeviceSwitch> */}
</ElAside>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,30 @@ const props = defineProps({
})
</script>
<template>
<el-form-item size="default" :label="t(`er.public.${props.field}`)">
<span class="subhead">{{t('er.public.unit')}}:px</span>
<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].top"
v-model="target.style[props.field].left"
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].left"
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"
Expand All @@ -60,8 +60,6 @@ const props = defineProps({
controls-position="right"
/>
</el-col>
</el-row>
<el-row :gutter="14" justify="center">
<el-col :span="12">
<el-input-number
:step="10"
Expand All @@ -73,41 +71,50 @@ const props = defineProps({
</el-col>
</el-row>
</div>
<!-- <el-row :gutter="14">-->
<!-- <el-col :span="12">-->
<!-- <div>Top</div>-->
<!-- <el-input-number-->
<!-- :step="10"-->
<!-- v-model="target.style[props.field].top"-->
<!-- controls-position="right"-->
<!-- />-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <div>Bottom</div>-->
<!-- <el-input-number-->
<!-- :step="10"-->
<!-- v-model="target.style[props.field].bottom"-->
<!-- controls-position="right"-->
<!-- />-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row :gutter="14">-->
<!-- <el-col :span="12">-->
<!-- <div>Left</div>-->
<!-- <el-input-number-->
<!-- :step="10"-->
<!-- v-model="target.style[props.field].left"-->
<!-- controls-position="right"-->
<!-- />-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <div>Right</div>-->
<!-- <el-input-number-->
<!-- :step="10"-->
<!-- v-model="target.style[props.field].right"-->
<!-- controls-position="right"-->
<!-- />-->
<!-- </el-col>-->
<!-- </el-row>-->
</el-form-item>
</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>
Loading

0 comments on commit ee24a8e

Please sign in to comment.