Skip to content

Commit 58a4acd

Browse files
authored
Merge pull request #5 from Liberty-liu/dev
fix: 1.Fix the getData method to verify the unique id
2 parents 2c34d33 + d6266d2 commit 58a4acd

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

examples/views/formEditor/objEdit.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useRoute } from 'vue-router'
44
import hooks from '@ER/hooks'
55
import { erFormEditor } from '@ER/formEditor'
66
import uri from '@ER-examples/uri.js'
7+
import _ from 'lodash-es'
78
import { ElMessage } from "element-plus"
89
const route = useRoute()
910
const {
@@ -46,6 +47,9 @@ const handleListener = async ({ type, data }) => {
4647
localStorage.setItem('er-lang', data)
4748
break
4849
case 'save':
50+
if (_.isEmpty(data)) {
51+
return false
52+
}
4953
loading.value = true
5054
try {
5155
const postData = {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "everright-formeditor",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"files": [
55
"dist",
66
"packages/formEditor/componentsConfig.js"

packages/formEditor/index.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,13 @@ const clearData = () => {
362362
// state.fields.splice(0)
363363
// state.store.splice(0)
364364
}
365-
const getData = props.layoutType === 1 ? getData1 : getData2
365+
const getData = () => {
366+
if (!state.validateStates.every(e => !e.isWarning)) {
367+
return {}
368+
} else {
369+
return (props.layoutType === 1 ? getData1 : getData2)()
370+
}
371+
}
366372
const setData = props.layoutType === 1 ? setData1 : setData2
367373
defineExpose({
368374
switchPlatform (platform) {
@@ -381,6 +387,7 @@ const handleOperation = (type, val) => {
381387
layout.mobile = []
382388
state.fields.splice(0)
383389
state.store.splice(0)
390+
state.data = {}
384391
setSelection('root')
385392
break
386393
case 3:

packages/hooks/use-props/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,11 @@ export const useProps = (state, data, isPc = true, isRoot = false, specialHandli
329329
break
330330
case 'rate':
331331
result.allowHalf = options.allowHalf
332-
result.max = options.max
332+
if (!isPc) {
333+
result.count = options.max
334+
} else {
335+
result.max = options.max
336+
}
333337
break
334338
case 'html':
335339
result.type = 'textarea'

0 commit comments

Comments
 (0)