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 {
},
},
},
mounted
()
{
console
.
log
(
this
.
$attrs
)
},
methods
:
{
handleSizeChange
(
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 @@
</el-scrollbar>
</div>
<treeNode-dialog
v-model
:visible
=
"dialogVisible"
title=
"添加选项"
@
commit=
"addNode"
/>
<treeNode-dialog
v-model
:visible
=
"ifEditor"
title=
"修改选项名"
@
commit=
"EditorNode"
/>
<icons-dialog
v-model
:visible
=
"iconsVisible"
:current=
"activeData[currentIconModel]"
@
select=
"setIcon"
/>
<treeNode-dialog
v-model=
"dialogVisible"
title=
"添加选项"
@
commit=
"addNode"
/>
<treeNode-dialog
v-model=
"ifEditor"
title=
"修改选项名"
@
commit=
"EditorNode"
/>
<icons-dialog
v-model=
"iconsVisible"
:current=
"activeData[currentIconModel]"
@
select=
"setIcon"
/>
</div>
</template>
...
...
@@ -789,11 +789,11 @@ export default {
addNode
(
data
)
{
this
.
currentNode
.
push
(
data
)
console
.
log
(
'this.currentNode'
,
this
.
currentNode
)
//
console.log('this.currentNode', this.currentNode)
},
EditorNode
(
data
)
{
console
.
log
(
'currentNode'
,
this
.
currentNode
)
console
.
log
(
'data'
,
data
)
//
console.log('currentNode', this.currentNode)
//
console.log('data', data)
this
.
currentNode
.
label
=
data
.
label
this
.
currentNode
.
value
=
data
.
value
},
...
...
vue3-lw-pc/src/views/drainageCode/smartForms/build/TreeNodeDialog.vue
View file @
288c8c8
...
...
@@ -115,7 +115,7 @@ export default {
},
onClose
()
{},
close
()
{
this
.
$emit
(
'update:
visibl
e'
,
false
)
this
.
$emit
(
'update:
model-valu
e'
,
false
)
},
handelConfirm
()
{
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 = [
labelWidth
:
null
,
style
:
{
width
:
'100%'
},
ssq
:
''
,
// props: {
// value: 'id',
// label: 'name',
// },
options
:
[],
props
:
{
value
:
'id'
,
label
:
'name'
,
},
'show-all-levels'
:
true
,
disabled
:
false
,
clearable
:
true
,
...
...
vue3-lw-pc/src/views/drainageCode/smartForms/build/generator/render.jsx
View file @
288c8c8
...
...
@@ -145,33 +145,8 @@ const componentChild = {
export
default
{
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
()
{
const
dataObject
=
{
// attrs: {},
// props: {},
// on: {},
// style: {},
}
const
dataObject
=
{}
const
confClone
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
conf
))
const
children
=
[]
...
...
@@ -201,14 +176,13 @@ export default {
// }
// })
debugger
// 配置省市区数据首次懒加载
if
(
confClone
.
formCodeId
==
9
)
{
debugger
dataObject
.
props
=
this
.
props
// 配置省市区数据首次加载
if
(
confClone
.
formCodeId
==
9
&&
!
this
.
conf
.
options
?.
length
)
{
getProvinceCityTree
().
then
((
data
)
=>
{
this
.
conf
.
options
=
data
})
}
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 {
this
.
activeFormItem
(
clone
)
},
cloneComponent
(
origin
)
{
debugger
const
clone
=
JSON
.
parse
(
JSON
.
stringify
(
origin
))
clone
.
formId
=
this
.
idGlobal
=
uuid
()
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