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
a91c95ae
Commit
a91c95ae
authored
Aug 19, 2024
by
王纵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口请求汇总
parent
14e90b9d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
85 additions
and
42 deletions
+85
-42
DLov.vue
src/Dynamic/ConfigRenderComponent/DForm/FormItem/DLov.vue
+5
-8
DSelect.vue
src/Dynamic/ConfigRenderComponent/DForm/FormItem/DSelect.vue
+3
-4
index.vue
src/Dynamic/ConfigRenderComponent/DForm/index.vue
+3
-3
DTableTd.jsx
src/Dynamic/ConfigRenderComponent/DTable/DTableTd.jsx
+3
-2
index.vue
src/Dynamic/ConfigRenderComponent/DTable/index.vue
+18
-15
index.vue
src/Dynamic/LayoutButtons/index.vue
+3
-6
service.js
src/Dynamic/service.js
+50
-4
No files found.
src/Dynamic/ConfigRenderComponent/DForm/FormItem/DLov.vue
View file @
a91c95ae
...
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-1
5 14:30:48
* @LastEditTime: 2024-08-1
9 10:58:15
* @Version: 1.0.0
* @Description: 动态渲染-Lov
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
...
@@ -95,8 +95,7 @@
<
script
>
import
{
Cell
,
Switch
,
Icon
,
Popup
,
Search
,
Checkbox
,
Tag
,
Field
}
from
'vant'
;
import
DLabel
from
'./DLabel'
;
import
hlsHttp
from
'../../../utils/hlsHttp'
;
import
{
getOrganizationId
}
from
'../../../utils/utils'
;
import
{
getLovConfig
,
getLovData
}
from
'../../../service'
;
export
default
{
name
:
'DLov'
,
...
...
@@ -184,7 +183,7 @@ export default {
},
methods
:
{
getLovConfig
()
{
hlsHttp
.
get
(
`/hpfm/v1/
${
getOrganizationId
()}
/lov-view/info`
,
{
viewCode
:
this
.
fieldConfig
.
lovCode
}).
then
(
res
=>
{
getLovConfig
(
{
viewCode
:
this
.
fieldConfig
.
lovCode
}).
then
(
res
=>
{
this
.
lovConfig
=
res
;
});
},
...
...
@@ -194,11 +193,9 @@ export default {
lovCode
,
page
:
this
.
page
,
size
:
this
.
size
,
tenantId
:
getOrganizationId
(),
...
this
.
cascadesParams
}
console
.
log
(
'cascadesParams'
,
this
.
cascadesParams
)
hlsHttp
.
get
(
queryUrl
,
params
).
then
(
res
=>
{
};
getLovData
(
queryUrl
,
params
).
then
(
res
=>
{
this
.
lovData
=
this
.
lovData
.
concat
(
res
.
content
.
map
(
item
=>
({...
item
,
_selected
:
false
})));
if
(
res
.
totalElements
>
this
.
lovData
.
length
)
{
this
.
page
=
this
.
page
+
1
;
...
...
src/Dynamic/ConfigRenderComponent/DForm/FormItem/DSelect.vue
View file @
a91c95ae
...
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-1
4 11:01:18
* @LastEditTime: 2024-08-1
9 11:01:14
* @Version: 1.0.0
* @Description: 动态渲染-Select
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
...
@@ -65,8 +65,7 @@
import
{
isNumber
}
from
'lodash'
;
import
{
Cell
,
Switch
,
Icon
,
Popup
,
Field
}
from
'vant'
;
import
DLabel
from
'./DLabel'
;
import
hlsHttp
from
'../../../utils/hlsHttp'
;
import
{
getOrganizationId
}
from
'../../../utils/utils'
;
import
{
getSelectOptions
}
from
'../../../service'
;
export
default
{
name
:
'DSelect'
,
...
...
@@ -157,7 +156,7 @@ export default {
},
methods
:
{
getOptions
()
{
hlsHttp
.
get
(
`/hpfm/v1/
${
getOrganizationId
()}
/lovs/data`
,
{
lovCode
:
this
.
fieldConfig
.
lookupCode
,
...
this
.
cascadesParams
}).
then
(
res
=>
{
getSelectOptions
(
{
lovCode
:
this
.
fieldConfig
.
lookupCode
,
...
this
.
cascadesParams
}).
then
(
res
=>
{
this
.
options
=
res
.
map
(
item
=>
({...
item
,
_selected
:
false
}));
});
},
...
...
src/Dynamic/ConfigRenderComponent/DForm/index.vue
View file @
a91c95ae
...
...
@@ -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-1
6 10:13:28
* @LastEditTime: 2024-08-1
9 10:59:43
* @Version: 1.0.0
* @Description: 表单渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
...
@@ -138,7 +138,7 @@ import DDate from './FormItem/DDate';
import
DCheckbox
from
'./FormItem/DCheckbox'
;
import
DUrl
from
'./FormItem/DUrl'
;
import
DTitle
from
'../DTitle'
;
import
hlsHttp
from
'../../utils/hlsHttp
'
;
import
{
getFormData
}
from
'../../service
'
;
export
default
{
name
:
'DForm'
,
...
...
@@ -230,7 +230,7 @@ export default {
if
(
this
.
formType
===
'normal'
)
{
if
(
this
.
tabInfo
.
readUrl
)
{
// console.log('D-form-activated', this.tabInfo.readUrl, JSON.stringify(this.queryParams))
const
res
=
await
hlsHttp
.
get
(
this
.
tabInfo
.
readUrl
,
this
.
queryParams
)
const
res
=
await
getFormData
(
this
.
tabInfo
.
readUrl
,
this
.
queryParams
)
this
.
fieldsObj
=
res
.
content
.
length
?
res
.
content
[
0
]
:
{};
this
.
dataLoadHandle
(
this
.
fieldsObj
,
this
.
tabInfo
.
tabCode
);
// 数据查询后的回调
this
.
addFormRef
(
this
,
this
.
tabInfo
.
tabCode
);
//正常表单保存表单组件实例,供页面整体保存时使用
...
...
src/Dynamic/ConfigRenderComponent/DTable/DTableTd.jsx
View file @
a91c95ae
...
...
@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-30 09:41:54
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-1
5 17:06:59
* @LastEditTime: 2024-08-1
9 11:18:32
* @Version: 1.0.0
* @Description: 表格列渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
...
@@ -52,7 +52,8 @@ const DTableTd = {
render
:
function
(
h
,
context
)
{
return
this
.
tdRender
?
this
.
tdRender
(
this
.
record
,
this
.
index
)
:
<
span
>
{
this
.
$slots
.
default
||
(
this
.
columnValue
()
||
'--'
)
}
</
span
>
<
span
><
slot
>
{
this
.
columnValue
()
||
'--'
}
</
slot
></
span
>
// <span>{this.$slots.default || (this.columnValue() || '--')}</span>
}
};
...
...
src/Dynamic/ConfigRenderComponent/DTable/index.vue
View file @
a91c95ae
...
...
@@ -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-1
6 10:27:18
* @LastEditTime: 2024-08-1
9 11:17:46
* @Version: 1.0.0
* @Description: 表格渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
...
@@ -16,7 +16,7 @@
:showBtns=
"!readOnly"
/>
<scroll
<
d-
scroll
ref=
"scroll"
:pullUp=
"true"
:pull-down=
"true"
@
pullingUp=
"getList"
@
pullingDown=
"getList"
style=
"max-height: calc(100vh - 130px)"
...
...
@@ -44,11 +44,14 @@
:index=
"pIndex"
:typeDisplay=
"column.validationTypeDisplay"
>
<template
v-if=
"booleanType.includes(column.validationTypeDisplay)"
>
{{
booleanDisplay
[
item
[
column
.
columnName
]]
||
'--'
}}
</
template
>
<
template
v-if=
"dateType[column.dataType]"
>
{{
dateDescription
(
dateType
[
column
.
dataType
],
item
[
column
.
columnName
])
||
'--'
}}
<template
#
default
>
<fragment
v-if=
"booleanType.includes(column.validationTypeDisplay)"
>
{{
booleanDisplay
[
item
[
column
.
columnName
]]
||
'--'
}}
</fragment>
<fragment
v-if=
"dateType[column.dataType]"
>
{{
dateDescription
(
dateType
[
column
.
dataType
],
item
[
column
.
columnName
])
||
'--'
}}
</fragment>
</
template
>
<!-- {{(column.validationTypeDisplay === 'Switch' ? (item[column.columnName] ? '是' : '否' ) : item[column.columnName]) || '--'}} -->
</d-table-td>
...
...
@@ -81,17 +84,18 @@
</div>
</van-popup>
</scroll>
</
d-
scroll>
</fragment>
</template>
<
script
>
import
{
DScroll
}
from
'../../LayoutComponents'
;
import
DTitle
from
'../DTitle'
;
import
DForm
from
'../DForm'
;
import
DTableTd
from
'./DTableTd.jsx'
;
import
{
Checkbox
,
CheckboxGroup
,
Popup
,
Button
,
Icon
,
Toast
}
from
'vant'
;
import
hlsHttp
from
'../../utils/hlsHttp
'
;
import
{
getDataSetName
,
getOrganizationId
,
dateFormat
}
from
'../../utils/utils'
;
import
{
getTableData
,
saveTableRecord
,
deleteTableRecords
}
from
'../../service
'
;
import
{
getDataSetName
,
dateFormat
}
from
'../../utils/utils'
;
import
EventBus
from
'../../utils/eventBus'
;
export
default
{
...
...
@@ -100,6 +104,7 @@ export default {
DTitle
,
DForm
,
DTableTd
,
DScroll
,
[
Button
.
name
]:
Button
,
[
Checkbox
.
name
]:
Checkbox
,
[
CheckboxGroup
.
name
]:
CheckboxGroup
,
...
...
@@ -202,7 +207,7 @@ export default {
...
this
.
queryParams
,
...
this
.
dynamicConfigInfo
.
queryParams
,
}
hlsHttp
.
get
(
this
.
tabInfo
.
readUrl
,
params
).
then
(
res
=>
{
getTableData
(
this
.
tabInfo
.
readUrl
,
params
).
then
(
res
=>
{
this
.
tableData
=
this
.
tableData
.
concat
(
res
.
content
||
[]);
this
.
dataLoadHandle
(
this
.
tableData
,
this
.
tabInfo
.
tabCode
)
// EventBus.$on('dataLoad', this.tableData, this.tabInfo.tabCode); // 将查询的数据
...
...
@@ -234,7 +239,7 @@ export default {
},
async
saveRecord
()
{
const
{
allValues
}
=
await
this
.
$refs
.
dformRef
.
validate
();
hlsHttp
.
post
(
this
.
tabInfo
.
createUrl
,
[{...
allValues
,
...
this
.
dynamicConfigInfo
.
queryParams
}]).
then
(()
=>
{
saveTableRecord
(
this
.
tabInfo
.
createUrl
,
[{...
allValues
,
...
this
.
dynamicConfigInfo
.
queryParams
}]).
then
(()
=>
{
this
.
visible
=
false
;
Toast
.
success
(
'保存成功!'
);
this
.
init
();
...
...
@@ -247,9 +252,7 @@ export default {
deleteRecords
()
{
let
result
=
this
.
tableData
.
filter
(
o
=>
this
.
checkResult
.
includes
(
o
[
this
.
tabInfo
.
primaryKey
]));
const
dataSetName
=
getDataSetName
(
this
.
dynamicConfigInfo
.
dataSetObject
,
this
.
tabInfo
.
tabCode
);
const
url
=
this
.
tabInfo
.
destroyUrl
||
`/hllc/v1/
${
getOrganizationId
()}
/dynamic-crud/delete
${
dataSetName
?
'?datasetName='
+
dataSetName
:
''
}
`
;
hlsHttp
.
delete
(
url
,
result
).
then
(
res
=>
{
deleteTableRecords
(
this
.
tabInfo
.
destroyUrl
,
dataSetName
,
result
).
then
(
res
=>
{
Toast
.
success
(
'删除成功!'
);
this
.
init
();
})
...
...
src/Dynamic/LayoutButtons/index.vue
View file @
a91c95ae
...
...
@@ -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-1
5 10:18:13
* @LastEditTime: 2024-08-1
9 11:09:17
* @Version: 1.0.0
* @Description: 页面按钮渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
...
...
@@ -47,8 +47,7 @@
<
script
>
import
{
Button
,
Icon
,
Popover
,
Toast
}
from
'vant'
;
import
{
v4
as
uuidv4
}
from
'uuid'
;
import
hlsHttp
from
'../utils/hlsHttp'
;
import
{
getOrganizationId
}
from
'../utils/utils'
;
import
{
save
}
from
'../service'
;
export
default
{
name
:
'LayoutButtons'
,
...
...
@@ -145,9 +144,7 @@ export default {
}
}
const
{
layoutCode
,
metaKeys
,
dataSetMap
}
=
this
.
getDataSets
(
dataSets
);
hlsHttp
.
post
(
`/hllc/v1/
${
getOrganizationId
()}
/dynamic-crud/save`
,
[{
layoutCode
,
metaKeys
,
...
dataSetMap
}]).
then
(
res
=>
{
save
([{
layoutCode
,
metaKeys
,
...
dataSetMap
}]).
then
(
res
=>
{
Toast
.
success
(
'保存成功!'
);
})
},
...
...
src/Dynamic/service.js
View file @
a91c95ae
...
...
@@ -2,13 +2,13 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-08-09 10:54:02
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-
09 14:42:17
* @LastEditTime: 2024-08-
19 11:08:33
* @Version: 1.0.0
* @Description: 页面配置请求
* @Copyright: Copyright (c) 2021, Hand-RongJing
*/
import
{
getOrganizationId
}
from
'./utils/utils'
;
import
{
get
}
from
'./utils/hlsHttp'
import
hlsHttp
from
'./utils/hlsHttp'
export
async
function
query
(
layoutCode
,
param
)
{
let
config
=
{
...
...
@@ -16,7 +16,7 @@ export async function query(layoutCode, param) {
param
:
{},
};
try
{
const
data
=
await
get
(
`/hllc/v1/
${
getOrganizationId
()}
/doc-layouts/config/app/
${
layoutCode
}
`
,
param
);
const
data
=
await
hlsHttp
.
get
(
`/hllc/v1/
${
getOrganizationId
()}
/doc-layouts/config/app/
${
layoutCode
}
`
,
param
);
config
.
param
=
param
;
config
.
datas
=
data
||
{};
return
config
;
...
...
@@ -31,7 +31,7 @@ export async function queryRoute(match, param) {
param
:
{},
};
try
{
const
res
=
await
get
(
const
res
=
await
hlsHttp
.
get
(
`/hllc/v1/
${
getOrganizationId
()}
/rule-engine-low-code?route=
${
window
.
encodeURIComponent
(
match
)}
`
...
...
@@ -47,3 +47,49 @@ export async function queryRoute(match, param) {
}
}
// 获取下拉框值
export
function
getSelectOptions
(
params
)
{
return
hlsHttp
.
get
(
`/hpfm/v1/
${
getOrganizationId
()}
/lovs/data`
,
params
);
}
// 获取lov配置信息
export
function
getLovConfig
(
params
)
{
return
hlsHttp
.
get
(
`/hpfm/v1/
${
getOrganizationId
()}
/lov-view/info`
,
params
);
}
// 获取lov数据
export
function
getLovData
(
url
,
params
)
{
const
newParams
=
{
...
params
,
tenantId
:
getOrganizationId
(),
}
return
hlsHttp
.
get
(
url
,
newParams
);
}
// 获取表单数据
export
function
getFormData
(
url
,
params
)
{
return
hlsHttp
.
get
(
url
,
params
);
}
// 获取表格数据
export
function
getTableData
(
url
,
params
)
{
return
hlsHttp
.
get
(
url
,
params
);
}
// 表格单条数据保存
export
function
saveTableRecord
(
url
,
params
)
{
return
hlsHttp
.
post
(
url
,
params
);
}
// 表格删除
export
function
deleteTableRecords
(
destroyUrl
,
dataSetName
,
params
)
{
const
url
=
destroyUrl
||
`/hllc/v1/
${
getOrganizationId
()}
/dynamic-crud/delete
${
dataSetName
?
'?datasetName='
+
dataSetName
:
''
}
`
;
return
hlsHttp
.
delete
(
url
,
params
);
}
// 页面大保存
export
function
save
(
params
)
{
return
hlsHttp
.
post
(
`/hllc/v1/
${
getOrganizationId
()}
/dynamic-crud/save`
,
params
);
}
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