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
a16c3377
Commit
a16c3377
authored
Aug 20, 2024
by
王纵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加表格表单实例
parent
b1d07201
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
18 deletions
+19
-18
index.vue
src/Dynamic/ConfigRenderComponent/DForm/index.vue
+3
-3
index.vue
src/Dynamic/ConfigRenderComponent/DTable/index.vue
+3
-2
index.vue
src/Dynamic/LayoutButtons/index.vue
+5
-5
index.vue
src/Dynamic/index.vue
+4
-4
utils.js
src/Dynamic/utils/utils.js
+4
-4
No files found.
src/Dynamic/ConfigRenderComponent/DForm/index.vue
View file @
a16c3377
...
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-20
12:11:27
* @LastEditTime: 2024-08-20
22:53:12
* @Version: 1.0.0
* @Description: 表单渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
...
@@ -188,7 +188,7 @@ export default {
default
:
()
=>
[]
}
},
inject
:
[
'dynamicInfo'
,
'add
Form
Ref'
,
'setDataSetData'
,
'dataLoadHandle'
],
inject
:
[
'dynamicInfo'
,
'addRef'
,
'setDataSetData'
,
'dataLoadHandle'
],
data
()
{
return
{
fieldComponents
:
[
'TextField'
,
"TextArea"
,
"NumberField"
,
"EmailField"
,
"CentField"
],
...
...
@@ -228,7 +228,7 @@ export default {
}
if
(
this
.
formType
===
'normal'
)
{
this
.
add
Form
Ref
(
this
,
this
.
tabInfo
.
tabCode
);
//正常表单保存表单组件实例,供页面整体保存时使用
this
.
addRef
(
this
,
this
.
tabInfo
.
tabCode
);
//正常表单保存表单组件实例,供页面整体保存时使用
if
(
this
.
tabInfo
.
readUrl
)
{
// console.log('D-form-activated', this.tabInfo.readUrl, JSON.stringify(this.queryParams))
const
res
=
await
getFormData
(
this
.
tabInfo
.
readUrl
,
this
.
queryParams
)
...
...
src/Dynamic/ConfigRenderComponent/DTable/index.vue
View file @
a16c3377
...
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-20 22:5
2:04
* @LastEditTime: 2024-08-20 22:5
6:42
* @Version: 1.0.0
* @Description: 表格渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
...
@@ -129,7 +129,7 @@ export default {
default
:
()
=>
[],
}
},
inject
:
[
'dynamicInfo'
,
'dataLoadHandle'
],
inject
:
[
'dynamicInfo'
,
'dataLoadHandle'
,
'addRef'
],
data
()
{
return
{
dateType
:
{
...
...
@@ -174,6 +174,7 @@ export default {
methods
:
{
init
()
{
this
.
$nextTick
(()
=>
{
this
.
addRef
(
this
,
this
.
tabInfo
.
tabCode
);
// 添加组件实例
this
.
dynamicConfigInfo
=
this
.
dynamicInfo
();
if
(
this
.
tabInfo
.
queryTabCode
)
{
EventBus
.
$on
(
'tableQuery'
,
this
.
listenHandle
);
...
...
src/Dynamic/LayoutButtons/index.vue
View file @
a16c3377
...
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-31 15:09:30
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-
19 11:09:17
* @LastEditTime: 2024-08-
20 22:57:16
* @Version: 1.0.0
* @Description: 页面按钮渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
...
@@ -135,10 +135,10 @@ export default {
const
saveDataSet
=
this
.
dynamicInfo
().
dataSetObject
;
const
dataSets
=
{...
saveDataSet
};
for
(
let
key
in
dataSets
)
{
if
(
dataSets
.
hasOwnProperty
(
key
))
{
// 确保key是对象自身的属性
const
{
form
Ref
}
=
dataSets
[
key
];
if
(
form
Ref
)
{
const
values
=
await
form
Ref
.
validate
();
if
(
dataSets
.
hasOwnProperty
(
key
)
&&
dataSets
[
key
].
type
===
'Form'
)
{
// 确保key是对象自身的属性
const
{
instance
Ref
}
=
dataSets
[
key
];
if
(
instance
Ref
)
{
const
values
=
await
instance
Ref
.
validate
();
dataSets
[
key
].
submitValues
=
values
;
}
}
...
...
src/Dynamic/index.vue
View file @
a16c3377
...
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-
19 14:27:15
* @LastEditTime: 2024-08-
20 22:55:00
* @Version: 1.0.0
* @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
...
@@ -110,7 +110,7 @@ export default {
},
provide
()
{
return
{
add
FormRef
:
this
.
addForm
Ref
,
add
Ref
:
this
.
add
Ref
,
setDataSetData
:
this
.
setDataSetData
,
dataLoadHandle
:
this
.
dataLoadHandle
,
dynamicInfo
:
this
.
getDynamicInfo
...
...
@@ -180,8 +180,8 @@ export default {
}
return
obj
;
},
add
Form
Ref
(
ref
,
tabCode
)
{
// 添加表单实例
this
.
dataSetObject
[
tabCode
].
form
Ref
=
ref
;
addRef
(
ref
,
tabCode
)
{
// 添加表单实例
this
.
dataSetObject
[
tabCode
].
instance
Ref
=
ref
;
},
setDataSetData
(
tabCode
,
data
)
{
this
.
dataSetObject
[
tabCode
].
data
=
data
;
...
...
src/Dynamic/utils/utils.js
View file @
a16c3377
...
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-30 14:39:47
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-20
09:57:50
* @LastEditTime: 2024-08-20
22:55:32
* @Version: 1.0.0
* @Description: 工具类
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
...
@@ -96,7 +96,7 @@ const dateFormat = (type, time) => { // 时间格式化 2019-09-08
// 根据tabcode获取对应的表单值
const
getFormValuesByTabCode
=
async
(
dataSets
,
tabCode
)
=>
{
const
formRef
=
dataSets
[
tabCode
].
form
Ref
;
const
formRef
=
dataSets
[
tabCode
].
instance
Ref
;
if
(
formRef
)
{
const
values
=
await
formRef
.
validate
();
return
values
;
...
...
@@ -109,8 +109,8 @@ const getFormValuesByTabCode = async (dataSets, tabCode) => {
// 根据tabcode获取对应的组件ref
const
getRefByTabCode
=
(
dataSets
,
tabCode
)
=>
{
const
formRef
=
dataSets
[
tabCode
].
form
Ref
;
return
form
Ref
;
const
instanceRef
=
dataSets
[
tabCode
].
instance
Ref
;
return
instance
Ref
;
}
const
getOrganizationId
=
()
=>
{
...
...
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