Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-easy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
easyUI
hls-easy-ui
Commits
eb63b2be
Commit
eb63b2be
authored
Aug 16, 2024
by
王纵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加表格表单按钮自定义方法
parent
ad09e035
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
38 deletions
+77
-38
index.vue
src/Dynamic/ConfigRenderComponent/DForm/index.vue
+12
-1
index.vue
src/Dynamic/ConfigRenderComponent/DTable/index.vue
+25
-21
index.vue
src/Dynamic/ConfigRenderComponent/DTitle/index.vue
+4
-4
LayoutBuilder.jsx
src/Dynamic/ConfigRenderComponent/LayoutBuilder.jsx
+9
-4
index.vue
src/Dynamic/ConfigRenderComponent/QueryForm/index.vue
+14
-5
index.jsx
src/Dynamic/ConfigRenderComponent/index.jsx
+7
-2
index.vue
src/Dynamic/index.vue
+6
-1
No files found.
src/Dynamic/ConfigRenderComponent/DForm/index.vue
View file @
eb63b2be
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56
* @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-1
5 17:48:20
* @LastEditTime: 2024-08-1
6 10:12:21
* @Version: 1.0.0
* @Version: 1.0.0
* @Description: 表单渲染
* @Description: 表单渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
:title=
"tabInfo.description"
:title=
"tabInfo.description"
:tabButtons=
"tabInfo.tabButtons || []"
:tabButtons=
"tabInfo.tabButtons || []"
:showBtns=
"!readOnly"
:showBtns=
"!readOnly"
:buttonsFun=
"buttonsClick"
/>
/>
<van-form
ref=
"formRef"
error-message-align=
"right"
input-align=
"right"
>
<van-form
ref=
"formRef"
error-message-align=
"right"
input-align=
"right"
>
...
@@ -181,6 +182,10 @@ export default {
...
@@ -181,6 +182,10 @@ export default {
originFields
:
{
originFields
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[]
default
:
()
=>
[]
},
componentButtons
:
{
type
:
Array
,
default
:
()
=>
[]
}
}
},
},
inject
:
[
'dynamicInfo'
,
'addFormRef'
,
'setDataSetData'
,
'dataLoadHandle'
],
inject
:
[
'dynamicInfo'
,
'addFormRef'
,
'setDataSetData'
,
'dataLoadHandle'
],
...
@@ -332,6 +337,12 @@ export default {
...
@@ -332,6 +337,12 @@ export default {
},
},
getCurrentRecord
()
{
getCurrentRecord
()
{
return
this
.
fieldsObj
;
return
this
.
fieldsObj
;
},
buttonsClick
(
btn
)
{
const
customBtn
=
this
.
componentButtons
.
find
(
o
=>
o
.
name
===
btn
.
name
);
// 采用页面传入的方法
if
(
customBtn
&&
customBtn
.
clickFunction
)
{
customBtn
.
clickFunction
();
}
}
}
},
},
}
}
...
...
src/Dynamic/ConfigRenderComponent/DTable/index.vue
View file @
eb63b2be
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56
* @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-1
5 17:42:48
* @LastEditTime: 2024-08-1
6 10:12:01
* @Version: 1.0.0
* @Version: 1.0.0
* @Description: 表格渲染
* @Description: 表格渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
@@ -112,9 +112,9 @@ export default {
...
@@ -112,9 +112,9 @@ export default {
type
:
Object
,
type
:
Object
,
default
:
()
=>
{}
default
:
()
=>
{}
},
},
b
uttons
:
{
componentB
uttons
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[]
,
default
:
()
=>
[]
},
},
columns
:
{
columns
:
{
type
:
Array
,
type
:
Array
,
...
@@ -255,6 +255,10 @@ export default {
...
@@ -255,6 +255,10 @@ export default {
})
})
},
},
buttonsClick
(
btn
)
{
buttonsClick
(
btn
)
{
const
customBtn
=
this
.
componentButtons
.
find
(
o
=>
o
.
name
===
btn
.
name
);
// 采用页面传入的方法
if
(
customBtn
&&
customBtn
.
clickFunction
)
{
customBtn
.
clickFunction
();
}
else
{
switch
(
btn
.
name
)
{
switch
(
btn
.
name
)
{
case
'create'
:
case
'create'
:
this
.
showRecord
({},
-
1
);
this
.
showRecord
({},
-
1
);
...
@@ -274,7 +278,7 @@ export default {
...
@@ -274,7 +278,7 @@ export default {
default
:
default
:
}
}
}
}
}
},
},
}
}
</
script
>
</
script
>
...
...
src/Dynamic/ConfigRenderComponent/DTitle/index.vue
View file @
eb63b2be
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Author: zong.wang01@hand-china.com
* @Date: 2024-08-02 15:32:36
* @Date: 2024-08-02 15:32:36
* @LastEditors: zong.wang01@hand-china.com
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-1
5 16:00:59
* @LastEditTime: 2024-08-1
6 10:08:37
* @Version: 1.0.0
* @Version: 1.0.0
* @Description: 组件头部渲染
* @Description: 组件头部渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
@@ -86,9 +86,9 @@ export default {
...
@@ -86,9 +86,9 @@ export default {
mounted
()
{
mounted
()
{
this
.
init
();
this
.
init
();
},
},
//
activated() {
activated
()
{
//
this.init();
this
.
init
();
//
},
},
methods
:
{
methods
:
{
init
()
{
init
()
{
if
(
this
.
tabButtons
.
length
>
this
.
num
)
{
if
(
this
.
tabButtons
.
length
>
this
.
num
)
{
...
...
src/Dynamic/ConfigRenderComponent/LayoutBuilder.jsx
View file @
eb63b2be
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-30 21:21:37
* @Date: 2024-07-30 21:21:37
* @LastEditors: zong.wang01@hand-china.com
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-1
5 17:34:58
* @LastEditTime: 2024-08-1
6 10:01:26
* @Version: 1.0.0
* @Version: 1.0.0
* @Description:
* @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
@@ -354,6 +354,8 @@ class BaseComponentBuilder extends BaseBuilder {
...
@@ -354,6 +354,8 @@ class BaseComponentBuilder extends BaseBuilder {
this
.
staticComponents
=
[];
this
.
staticComponents
=
[];
this
.
componentButtons
=
[];
this
.
setTabRef
=
null
;
this
.
setTabRef
=
null
;
this
.
routeParams
=
{};
// 路由信息
this
.
routeParams
=
{};
// 路由信息
...
@@ -476,9 +478,10 @@ class BaseComponentBuilder extends BaseBuilder {
...
@@ -476,9 +478,10 @@ class BaseComponentBuilder extends BaseBuilder {
props
:
{
props
:
{
key
:
refKey
,
key
:
refKey
,
tabInfo
:
this
.
props
,
tabInfo
:
this
.
props
,
buttons
:
this
.
buttons
,
//
buttons: this.buttons,
columns
:
this
.
columns
.
fields
,
columns
:
this
.
columns
.
fields
,
originColumns
:
this
.
columns
.
_originFields
originColumns
:
this
.
columns
.
_originFields
,
componentButtons
:
this
.
componentButtons
},
},
ref
:
`DTABLE_
${
this
.
tabCode
}
`
,
ref
:
`DTABLE_
${
this
.
tabCode
}
`
,
},
},
...
@@ -498,6 +501,7 @@ class BaseComponentBuilder extends BaseBuilder {
...
@@ -498,6 +501,7 @@ class BaseComponentBuilder extends BaseBuilder {
fields
:
newFields
.
fields
,
fields
:
newFields
.
fields
,
originFields
:
newFields
.
_originFields
,
originFields
:
newFields
.
_originFields
,
tabInfo
:
this
.
props
,
tabInfo
:
this
.
props
,
componentButtons
:
this
.
componentButtons
},
},
ref
:
`DFORM_
${
this
.
tabCode
}
`
,
ref
:
`DFORM_
${
this
.
tabCode
}
`
,
}
}
...
@@ -509,8 +513,9 @@ class BaseComponentBuilder extends BaseBuilder {
...
@@ -509,8 +513,9 @@ class BaseComponentBuilder extends BaseBuilder {
props
:
{
props
:
{
fields
:
newFields
.
fields
,
fields
:
newFields
.
fields
,
originFields
:
newFields
.
_originFields
,
originFields
:
newFields
.
_originFields
,
buttons
:
this
.
props
.
tabButtons
,
//
buttons: this.props.tabButtons,
tabInfo
:
this
.
props
,
tabInfo
:
this
.
props
,
componentButtons
:
this
.
componentButtons
}
}
}
}
);
);
...
...
src/Dynamic/ConfigRenderComponent/QueryForm/index.vue
View file @
eb63b2be
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56
* @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-1
5 17:07:36
* @LastEditTime: 2024-08-1
6 10:07:52
* @Version: 1.0.0
* @Version: 1.0.0
* @Description: 查询表单渲染
* @Description: 查询表单渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
@@ -68,6 +68,10 @@ export default {
...
@@ -68,6 +68,10 @@ export default {
originFields
:
{
originFields
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[]
default
:
()
=>
[]
},
componentButtons
:
{
type
:
Array
,
default
:
()
=>
[]
}
}
},
},
data
()
{
data
()
{
...
@@ -92,11 +96,16 @@ export default {
...
@@ -92,11 +96,16 @@ export default {
this
.
show
=
true
;
this
.
show
=
true
;
},
},
btnFun
(
btn
)
{
btnFun
(
btn
)
{
const
customBtn
=
this
.
componentButtons
.
find
(
o
=>
o
.
name
===
btn
.
name
);
if
(
customBtn
&&
customBtn
.
clickFunction
)
{
customBtn
.
clickFunction
();
}
else
{
if
(
btn
.
name
===
'query'
)
{
if
(
btn
.
name
===
'query'
)
{
this
.
query
();
this
.
query
();
}
else
if
(
btn
.
name
===
'reset'
)
{
}
else
if
(
btn
.
name
===
'reset'
)
{
this
.
reset
();
this
.
reset
();
}
}
}
},
},
async
query
()
{
async
query
()
{
const
{
formValues
}
=
await
this
.
$refs
.
dformRef
.
validate
();
const
{
formValues
}
=
await
this
.
$refs
.
dformRef
.
validate
();
...
...
src/Dynamic/ConfigRenderComponent/index.jsx
View file @
eb63b2be
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-30 09:41:54
* @Date: 2024-07-30 09:41:54
* @LastEditors: zong.wang01@hand-china.com
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-1
5 16:44:45
* @LastEditTime: 2024-08-1
6 09:59:16
* @Version: 1.0.0
* @Version: 1.0.0
* @Description:
* @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
@@ -35,7 +35,11 @@ const ConfigRenderComponent = {
...
@@ -35,7 +35,11 @@ const ConfigRenderComponent = {
staticLayoutTabs
:
{
staticLayoutTabs
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[],
default
:
()
=>
[],
}
},
componentButtons
:
{
type
:
Array
,
default
:
()
=>
[],
},
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -106,6 +110,7 @@ const ConfigRenderComponent = {
...
@@ -106,6 +110,7 @@ const ConfigRenderComponent = {
.
withTabCode
(
childrenTab
.
tabCode
)
.
withTabCode
(
childrenTab
.
tabCode
)
.
withProps
(
childrenTab
)
.
withProps
(
childrenTab
)
.
withStaticComponents
(
this
.
staticLayoutTabs
)
.
withStaticComponents
(
this
.
staticLayoutTabs
)
.
withComponentButtons
(
this
.
componentButtons
)
.
withParentProps
(
this
)
.
withParentProps
(
this
)
.
build
();
.
build
();
});
});
...
...
src/Dynamic/index.vue
View file @
eb63b2be
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56
* @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-1
5 17:42:29
* @LastEditTime: 2024-08-1
6 09:56:40
* @Version: 1.0.0
* @Version: 1.0.0
* @Description:
* @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
v-if=
"configDatas.id && !loading"
v-if=
"configDatas.id && !loading"
:componentRenderers=
"componentRenderers"
:componentRenderers=
"componentRenderers"
:staticLayoutTabs=
"staticLayoutTabs"
:staticLayoutTabs=
"staticLayoutTabs"
:componentButtons=
"componentButtons"
/>
/>
</h-content>
</h-content>
<layout-buttons
<layout-buttons
...
@@ -66,6 +67,10 @@ export default {
...
@@ -66,6 +67,10 @@ export default {
type
:
Object
,
type
:
Object
,
default
:
()
=>
({})
default
:
()
=>
({})
},
},
componentButtons
:
{
// 组件按钮方法
type
:
Array
,
default
:
()
=>
[]
},
staticLayoutTabs
:
{
// 静态布局内容
staticLayoutTabs
:
{
// 静态布局内容
type
:
Array
,
type
:
Array
,
default
:
()
=>
[]
default
:
()
=>
[]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment