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 d7f71b0a
authored
Jun 11, 2023
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
智能表单
1 parent
84226464
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
45 deletions
vue3-lw-pc/package.json
vue3-lw-pc/src/views/drainageCode/smartForms/build/DraggableItem.vue
vue3-lw-pc/src/views/drainageCode/smartForms/build/RightPanel.vue
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/views/groupMessage/add.vue
vue3-lw-pc/package.json
View file @
d7f71b0
...
...
@@ -24,7 +24,7 @@
"crypto-js"
:
"^4.1.1"
,
"driver.js"
:
"^0.9.8"
,
"echarts"
:
"^5.4.2"
,
"element-plus"
:
"^2.3.
4
"
,
"element-plus"
:
"^2.3.
6
"
,
"fabric"
:
"^5.3.0"
,
"file-saver"
:
"^2.0.5"
,
"fuse.js"
:
"^6.6.2"
,
...
...
vue3-lw-pc/src/views/drainageCode/smartForms/build/DraggableItem.vue
View file @
d7f71b0
...
...
@@ -3,14 +3,14 @@ import draggable from 'vuedraggable'
import
render
from
'./generator/render'
const
components
=
{
itemBtns
(
element
,
index
,
parent
)
{
const
{
copyItem
,
d
eleteItem
}
=
this
.
$attrs
const
{
onCopyItem
,
onD
eleteItem
}
=
this
.
$attrs
return
(
<>
<
span
class
=
'drawing-item-copy ssc'
title
=
'复制'
onClick
=
{(
event
)
=>
{
c
opyItem
(
element
,
parent
)
onC
opyItem
(
element
,
parent
)
event
.
stopPropagation
()
}}
>
<
el
-
icon
-
CopyDocument
class
=
'el-icon-CopyDocument'
/>
...
...
@@ -19,7 +19,7 @@ const components = {
class
=
'drawing-item-delete ssc'
title
=
'删除'
onClick
=
{(
event
)
=>
{
d
eleteItem
(
index
,
parent
)
onD
eleteItem
(
index
,
parent
)
event
.
stopPropagation
()
}}
>
<
el
-
icon
-
delete
class
=
'el-icon-delete'
/>
...
...
@@ -30,7 +30,7 @@ const components = {
}
const
layouts
=
{
colFormItem
(
element
,
index
,
parent
)
{
const
{
a
ctiveItem
}
=
this
.
$attrs
const
{
onA
ctiveItem
}
=
this
.
$attrs
console
.
log
(
'element.formId'
,
element
.
formId
)
let
className
=
this
.
activeId
===
element
.
formId
?
'drawing-item active-from-item'
:
'drawing-item'
//只是用顶部样式
...
...
@@ -42,7 +42,7 @@ const layouts = {
span
=
{
element
.
span
}
class
=
{
className
}
onClick
=
{(
event
)
=>
{
activeItem
&&
a
ctiveItem
(
element
)
onActiveItem
&&
onA
ctiveItem
(
element
)
event
.
stopPropagation
()
}}
>
<
el
-
form
-
item
...
...
@@ -80,7 +80,7 @@ const layouts = {
)
},
rowFormItem
(
element
,
index
,
parent
)
{
const
{
a
ctiveItem
}
=
this
.
$attrs
const
{
onA
ctiveItem
}
=
this
.
$attrs
const
className
=
this
.
activeId
===
element
.
formId
?
'drawing-row-item active-from-item'
:
'drawing-row-item'
let
child
=
renderChildren
.
apply
(
this
,
arguments
)
if
(
element
.
type
===
'flex'
)
{
...
...
@@ -97,7 +97,7 @@ const layouts = {
gutter
=
{
element
.
gutter
}
class
=
{
className
}
onClick
=
{(
event
)
=>
{
activeItem
&&
a
ctiveItem
(
element
)
onActiveItem
&&
onA
ctiveItem
(
element
)
event
.
stopPropagation
()
}}
>
<
span
class
=
'component-name'
>
{
element
.
componentName
}
<
/span
>
...
...
vue3-lw-pc/src/views/drainageCode/smartForms/build/RightPanel.vue
View file @
d7f71b0
...
...
@@ -113,7 +113,7 @@
:min=
"0"
:max=
"activeData.options.length"
placeholder=
"至少应选"
@
input=
"
$set(activeData, 'maxZ', $event ? $event : undefined)
"
/>
@
input=
"
activeData['maxZ'] = $event ? $event : undefined
"
/>
</el-form-item>
<el-form-item
v-if=
"activeData.tag === 'el-checkbox-group'"
label=
"最多可选"
>
<el-input-number
...
...
@@ -121,7 +121,7 @@
:min=
"0"
:max=
"activeData.options.length"
placeholder=
"最多可选"
@
input=
"
$set(activeData, 'max', $event ? $event : undefined)
"
/>
@
input=
"
activeData['max'] = $event ? $event : undefined
"
/>
</el-form-item>
<!-- <el-form-item v-if="activeData.prepend!==undefined" label="前缀">
<el-input v-model="activeData.prepend" placeholder="请输入前缀" />
...
...
@@ -294,7 +294,7 @@
</
template
>
</draggable>
<div
style=
"margin-left: 20px"
>
<el-button
style=
"padding-bottom: 0"
icon=
"el-icon-
circle - plus - outline
"
text
@
click=
"addSelectItem"
>
<el-button
style=
"padding-bottom: 0"
icon=
"el-icon-
CirclePlus
"
text
@
click=
"addSelectItem"
>
添加选项
</el-button>
</div>
...
...
@@ -333,7 +333,7 @@
:expand-on-click-node=
"false"
:render-content=
"renderContent"
/>
<div
v-if=
"activeData.dataType === 'static'"
style=
"margin-left: 20px"
>
<el-button
style=
"padding-bottom: 0"
icon=
"el-icon-
circle - plus - outline
"
text
@
click=
"addTreeItem"
>
<el-button
style=
"padding-bottom: 0"
icon=
"el-icon-
CirclePlus
"
text
@
click=
"addTreeItem"
>
添加父级
</el-button>
</div>
...
...
vue3-lw-pc/src/views/drainageCode/smartForms/build/generator/render.jsx
View file @
d7f71b0
...
...
@@ -19,9 +19,9 @@ const isAttr = makeMap(
)
function
vModel
(
self
,
dataObject
,
defaultValue
)
{
console
.
log
(
'defaultValue111'
,
defaultValue
)
console
.
log
(
'dataObject'
,
dataObject
)
console
.
log
(
'self'
,
self
)
//
console.log('defaultValue111', defaultValue)
//
console.log('dataObject', dataObject)
//
console.log('self', self)
if
(
dataObject
.
formCodeId
==
5
||
dataObject
.
formCodeId
==
625
)
{
if
(
defaultValue
)
{
console
.
log
(
'(/(^[1-9]d*$)/.test(defaultValue))'
,
/
(
^
[
1-9
]\d
*$
)
/
.
test
(
defaultValue
))
...
...
@@ -47,9 +47,9 @@ function vModel(self, dataObject, defaultValue) {
// console.log('dataObject.props', dataObject.props)
dataObject
[
'model-value'
]
=
defaultValue
//
dataObject.onInput = (val) => {
//
self.$emit('input', val)
//
}
dataObject
.
onInput
=
(
val
)
=>
{
self
.
$emit
(
'input'
,
val
)
}
}
const
componentChild
=
{
...
...
@@ -145,6 +145,26 @@ 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: {},
...
...
@@ -165,11 +185,13 @@ export default {
})
}
console
.
log
(
'confClone'
,
confClone
.
formCodeId
)
Object
.
keys
(
confClone
).
forEach
((
key
)
=>
{
const
val
=
confClone
[
key
]
if
(
confClone
.
layout
!=
'rowFormItem'
)
{
vModel
(
this
,
dataObject
,
confClone
.
defaultValue
)
}
if
(
confClone
.
layout
!=
'rowFormItem'
)
{
vModel
(
this
,
dataObject
,
confClone
.
defaultValue
)
}
Object
.
assign
(
dataObject
,
confClone
)
// Object.keys(confClone).forEach((key) => {
// const val = confClone[key]
// if (key === 'style') {
// Object.assign(dataObject[key], val)
// } else if (!isAttr(key)) {
...
...
@@ -177,29 +199,14 @@ export default {
// } else {
// dataObject.attrs[key] = val
// }
})
Object
.
assign
(
dataObject
,
confClone
)
// })
debugger
// 配置省市区数据首次懒加载
if
(
confClone
.
formCodeId
==
9
)
{
dataObject
.
props
=
{
value
:
'id'
,
label
:
'name'
,
lazy
:
true
,
lazyLoad
(
node
,
resolve
)
{
if
(
node
.
level
==
0
)
{
getProvinceCityTree
().
then
((
data
)
=>
{
resolve
(
data
)
})
}
else
{
if
(
node
.
level
==
2
)
{
node
.
data
.
children
.
forEach
((
e
)
=>
(
e
.
leaf
=
true
))
}
resolve
([])
}
},
}
debugger
dataObject
.
props
=
this
.
props
}
return
h
(
resolveComponent
(
this
.
conf
.
tag
),
dataObject
,
children
)
...
...
vue3-lw-pc/src/views/drainageCode/smartForms/build/index.vue
View file @
d7f71b0
...
...
@@ -398,7 +398,7 @@ export default {
activeFormItem
(
element
)
{
this
.
activeData
=
element
this
.
activeId
=
element
.
formId
//
this.$forceUpdate()
this
.
$forceUpdate
()
},
onEnd
(
obj
,
a
)
{
if
(
obj
.
from
!==
obj
.
to
)
{
...
...
@@ -412,6 +412,7 @@ export default {
this
.
activeFormItem
(
clone
)
},
cloneComponent
(
origin
)
{
debugger
const
clone
=
JSON
.
parse
(
JSON
.
stringify
(
origin
))
clone
.
formId
=
this
.
idGlobal
=
uuid
()
clone
.
span
=
formConf
.
span
...
...
@@ -460,8 +461,11 @@ export default {
document
.
getElementById
(
'copyNode'
).
click
()
},
empty
()
{
this
.
$confirm
(
'确定要清空所有组件吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
$confirm
(
'确定要清空所有组件吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}).
then
(()
=>
{
this
.
drawingList
=
[]
})
},
...
...
vue3-lw-pc/src/views/groupMessage/add.vue
View file @
d7f71b0
This diff is collapsed.
Click to expand it.
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