Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 288c8c8d
authored
Jun 12, 2023
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
智能表单element render children空数组与省市区加载问题
1 parent
e90aaa78
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
48 deletions
vue3-lw-pc/src/components/Pagination.vue
vue3-lw-pc/src/views/drainageCode/smartForms/build/RightPanel.vue
vue3-lw-pc/src/views/drainageCode/smartForms/build/TreeNodeDialog.vue
vue3-lw-pc/src/views/drainageCode/smartForms/build/generator/config.js
vue3-lw-pc/src/views/drainageCode/smartForms/build/generator/render.jsx
vue3-lw-pc/src/views/drainageCode/smartForms/build/index.vue
vue3-lw-pc/src/components/Pagination.vue
View file @
288c8c8
...
@@ -70,9 +70,6 @@ export default {
...
@@ -70,9 +70,6 @@ export default {
},
},
},
},
},
},
mounted
()
{
console
.
log
(
this
.
$attrs
)
},
methods
:
{
methods
:
{
handleSizeChange
(
val
)
{
handleSizeChange
(
val
)
{
this
.
$emit
(
'pagination'
,
{
page
:
this
.
currentPage
,
limit
:
val
})
this
.
$emit
(
'pagination'
,
{
page
:
this
.
currentPage
,
limit
:
val
})
...
...
vue3-lw-pc/src/views/drainageCode/smartForms/build/RightPanel.vue
View file @
288c8c8
...
@@ -526,9 +526,9 @@
...
@@ -526,9 +526,9 @@
</el-scrollbar>
</el-scrollbar>
</div>
</div>
<treeNode-dialog
v-model
:visible
=
"dialogVisible"
title=
"添加选项"
@
commit=
"addNode"
/>
<treeNode-dialog
v-model=
"dialogVisible"
title=
"添加选项"
@
commit=
"addNode"
/>
<treeNode-dialog
v-model
:visible
=
"ifEditor"
title=
"修改选项名"
@
commit=
"EditorNode"
/>
<treeNode-dialog
v-model=
"ifEditor"
title=
"修改选项名"
@
commit=
"EditorNode"
/>
<icons-dialog
v-model
:visible
=
"iconsVisible"
:current=
"activeData[currentIconModel]"
@
select=
"setIcon"
/>
<icons-dialog
v-model=
"iconsVisible"
:current=
"activeData[currentIconModel]"
@
select=
"setIcon"
/>
</div>
</div>
</template>
</template>
...
@@ -789,11 +789,11 @@ export default {
...
@@ -789,11 +789,11 @@ export default {
addNode
(
data
)
{
addNode
(
data
)
{
this
.
currentNode
.
push
(
data
)
this
.
currentNode
.
push
(
data
)
console
.
log
(
'this.currentNode'
,
this
.
currentNode
)
//
console.log('this.currentNode', this.currentNode)
},
},
EditorNode
(
data
)
{
EditorNode
(
data
)
{
console
.
log
(
'currentNode'
,
this
.
currentNode
)
//
console.log('currentNode', this.currentNode)
console
.
log
(
'data'
,
data
)
//
console.log('data', data)
this
.
currentNode
.
label
=
data
.
label
this
.
currentNode
.
label
=
data
.
label
this
.
currentNode
.
value
=
data
.
value
this
.
currentNode
.
value
=
data
.
value
},
},
...
...
vue3-lw-pc/src/views/drainageCode/smartForms/build/TreeNodeDialog.vue
View file @
288c8c8
...
@@ -115,7 +115,7 @@ export default {
...
@@ -115,7 +115,7 @@ export default {
},
},
onClose
()
{},
onClose
()
{},
close
()
{
close
()
{
this
.
$emit
(
'update:
visibl
e'
,
false
)
this
.
$emit
(
'update:
model-valu
e'
,
false
)
},
},
handelConfirm
()
{
handelConfirm
()
{
this
.
$refs
.
elForm
.
validate
((
valid
)
=>
{
this
.
$refs
.
elForm
.
validate
((
valid
)
=>
{
...
...
vue3-lw-pc/src/views/drainageCode/smartForms/build/generator/config.js
View file @
288c8c8
...
@@ -240,10 +240,11 @@ export const inputComponents = [
...
@@ -240,10 +240,11 @@ export const inputComponents = [
labelWidth
:
null
,
labelWidth
:
null
,
style
:
{
width
:
'100%'
},
style
:
{
width
:
'100%'
},
ssq
:
''
,
ssq
:
''
,
// props: {
options
:
[],
// value: 'id',
props
:
{
// label: 'name',
value
:
'id'
,
// },
label
:
'name'
,
},
'show-all-levels'
:
true
,
'show-all-levels'
:
true
,
disabled
:
false
,
disabled
:
false
,
clearable
:
true
,
clearable
:
true
,
...
...
vue3-lw-pc/src/views/drainageCode/smartForms/build/generator/render.jsx
View file @
288c8c8
...
@@ -145,33 +145,8 @@ const componentChild = {
...
@@ -145,33 +145,8 @@ const componentChild = {
export
default
{
export
default
{
props
:
[
'conf'
],
props
:
[
'conf'
],
data
()
{
return
{
props
:{
value
:
'id'
,
label
:
'name'
,
lazy
:
true
,
lazyLoad
(
node
,
resolve
)
{
debugger
if
(
node
.
level
==
0
)
{
getProvinceCityTree
().
then
((
data
)
=>
{
resolve
(
data
)
})
}
else
{
if
(
node
.
level
==
2
)
{
node
.
data
.
children
.
forEach
((
e
)
=>
(
e
.
leaf
=
true
))
}
resolve
([])
}
},
}}
},
render
()
{
render
()
{
const
dataObject
=
{
const
dataObject
=
{}
// attrs: {},
// props: {},
// on: {},
// style: {},
}
const
confClone
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
conf
))
const
confClone
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
conf
))
const
children
=
[]
const
children
=
[]
...
@@ -201,14 +176,13 @@ export default {
...
@@ -201,14 +176,13 @@ export default {
// }
// }
// })
// })
debugger
// 配置省市区数据首次加载
if
(
confClone
.
formCodeId
==
9
&&
!
this
.
conf
.
options
?.
length
)
{
// 配置省市区数据首次懒加载
getProvinceCityTree
().
then
((
data
)
=>
{
if
(
confClone
.
formCodeId
==
9
)
{
this
.
conf
.
options
=
data
debugger
})
dataObject
.
props
=
this
.
props
}
}
return
h
(
resolveComponent
(
this
.
conf
.
tag
),
dataObject
,
children
)
return
h
(
resolveComponent
(
this
.
conf
.
tag
),
dataObject
,
children
?.
length
?
children
:
undefined
)
},
},
}
}
vue3-lw-pc/src/views/drainageCode/smartForms/build/index.vue
View file @
288c8c8
...
@@ -412,7 +412,6 @@ export default {
...
@@ -412,7 +412,6 @@ export default {
this
.
activeFormItem
(
clone
)
this
.
activeFormItem
(
clone
)
},
},
cloneComponent
(
origin
)
{
cloneComponent
(
origin
)
{
debugger
const
clone
=
JSON
.
parse
(
JSON
.
stringify
(
origin
))
const
clone
=
JSON
.
parse
(
JSON
.
stringify
(
origin
))
clone
.
formId
=
this
.
idGlobal
=
uuid
()
clone
.
formId
=
this
.
idGlobal
=
uuid
()
clone
.
span
=
formConf
.
span
clone
.
span
=
formConf
.
span
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment