Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
hsWebHttpClient
Project
Project
Details
Activity
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
何虹
hsWebHttpClient
Commits
55d273e9
Commit
55d273e9
authored
Dec 06, 2021
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CONFIG_TOOL_API
parent
da044ec3
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
163 additions
and
60 deletions
+163
-60
hsWebHttpClient.js
dist/hsWebHttpClient.js
+10
-0
hsWebHttpClient.min.js
dist/hsWebHttpClient.min.js
+1
-1
commonModule.js
src/packages/common/commonModule.js
+2
-0
commonProxy.js
src/packages/common/commonProxy.js
+6
-5
webChartConfig.js
src/packages/modules/webChartConfig.js
+144
-54
No files found.
dist/hsWebHttpClient.js
View file @
55d273e9
...
...
@@ -22146,6 +22146,16 @@ class RestFul {
}
return
this
.
requestClient
.
delete
(
url_
,
bodyData
,
parms
)
}
// 兼容新版java的ref查询
get
(
data
){
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
parms
,
group
}
=
data
let
url_
=
`
${
this
.
MODULE_API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
url_
=
`
${
url_
}${
group
}
/`
}
return
this
.
requestClient
.
get
(
url_
,
parms
)
}
}
/* harmony default export */
__webpack_exports__
[
"default"
]
=
(
RestFul
);
...
...
dist/hsWebHttpClient.min.js
View file @
55d273e9
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/packages/common/commonModule.js
View file @
55d273e9
...
...
@@ -15,3 +15,5 @@ export const UN_CLOSE_BILLS = `${COMMON_UTIL_PROXY}/un_close_bills/`
export
const
SEND_BILLS
=
`
${
COMMON_UTIL_PROXY
}
/send_bills/`
export
const
UN_SEND_BILLS
=
`
${
COMMON_UTIL_PROXY
}
/un_send_bills/`
export
const
REJECT_BILLS
=
`
${
COMMON_UTIL_PROXY
}
/reject_bills/`
export
const
CONFIG_TOOL_API
=
`
${
COMMON_UTIL_PROXY
}
/`
src/packages/common/commonProxy.js
View file @
55d273e9
export
const
OAUTH_PROXY
=
'OAUTH_PROXY'
// `http://${api}/HSRight/api/`
export
const
OAUTH_PROXY
=
'OAUTH_PROXY'
// `http://${api}/HSRight/api/`
export
const
TOOL_PROXY
=
'TOOL_PROXY'
// `http://${api}/Tool/api/`
export
const
HSRIGHT_TOOL_PROXY
=
'HSRIGHT_TOOL_PROXY'
// `http://${api}/HSRightTool/api/`
export
const
HSRIGHT_TOOL_PROXY
=
'HSRIGHT_TOOL_PROXY'
// `http://${api}/HSRightTool/api/`
export
const
COMMON_UTIL_PROXY
=
'COMMON_UTIL_PROXY'
// `http://${api}/CommonUtil/api/`
export
const
COMMON_PROXY
=
'COMMON_PROXY'
// `http://${api}/`
export
const
GQL_PROXY
=
'GQL_PROXY'
// `http://${api}/GQL/api/`
export
const
FILE_RESOURCE_PROXY
=
'FILE_RESOURCE_PROXY'
// `http://${api}/fileresource/api/`
export
const
SERVICE_PROXY
=
'SERVICE_PROXY'
// `SERVICE_PROXY`
export
const
GQL_PROXY
=
'GQL_PROXY'
// `http://${api}/GQL/api/`
export
const
FILE_RESOURCE_PROXY
=
'FILE_RESOURCE_PROXY'
// `http://${api}/fileresource/api/`
export
const
SERVICE_PROXY
=
'SERVICE_PROXY'
// `SERVICE_PROXY`
export
const
SERVICE_PROXY
=
'CONFIG_TOOL_PROXY'
// `新模式toolconfig`
src/packages/modules/webChartConfig.js
View file @
55d273e9
import
{
WEB_QUERY
,
WEB_QUERY_QUERY
,
WEB_QUERY_QUERY_VALUE
,
WEB_QUERY_PAGE
}
from
'../common/commonModule'
import
{
WEB_QUERY
,
WEB_QUERY_QUERY
,
WEB_QUERY_QUERY_VALUE
,
WEB_QUERY_PAGE
,
CONFIG_TOOL_API
}
from
'../common/commonModule'
import
hsUtil
from
'hs-util-js'
const
urlParam
=
hsUtil
.
SystemModule
.
getUrlParams
()
const
config_db_name
=
hsUtil
.
SystemModule
.
getURLParameters
().
config_db_name
class
Control
{
constructor
(
requestClient
)
{
constructor
(
requestClient
)
{
console
.
log
(
'WebChartConfigModule'
)
this
.
requestClient
=
requestClient
this
.
moduleName
=
'WebChartConfigModule'
}
...
...
@@ -44,19 +51,39 @@ class Control {
* sData: 数据
* @param {*} data
*/
webChartConfigSave
(
param
)
{
// routerParms: page路由 position位置 other参数, sConfig 配置json sData 数据json
webChartConfigSave
(
param
)
{
// routerParms: page路由 position位置 other参数, sConfig 配置json sData 数据json
this
.
packParamHandle
(
param
)
const
{
appCode
,
pageName
,
controlName
,
controlType
,
querySql
,
mockData
,
userId
,
dbName
,
dbCode
,
config
,
data
,
configType
}
=
param
const
{
appCode
,
pageName
,
controlName
,
controlType
,
querySql
,
mockData
,
userId
,
dbName
,
dbCode
,
config
,
data
,
configType
}
=
param
const
postData
=
{
exec_sql
:
`EXEC dbo.spappWebChartConfig_Save @sAppCode='
${
appCode
}
',@sPage='
${
pageName
}
',@sControl='
${
controlName
}
',@sControlType='
${
controlType
||
''
}
',@sConfig=:sConfig,@sData=:sData,@sQuerySql='
${
querySql
||
''
}
',@bMockData='
${
mockData
||
''
}
',@iUserId='
${
userId
}
',@iConfigType='
${
configType
}
'`
,
db_name
:
dbName
||
this
.
requestClient
.
getDbName
(),
exec_sql
:
`EXEC dbo.spappWebChartConfig_Save @sAppCode='
${
appCode
}
',@sPage='
${
pageName
}
',@sControl='
${
controlName
}
',@sControlType='
${
controlType
||
''
}
',@sConfig=:sConfig,@sData=:sData,@sQuerySql='
${
querySql
||
''
}
',@bMockData='
${
mockData
||
''
}
',@iUserId='
${
userId
}
',@iConfigType='
${
configType
}
'`
,
db_name
:
this
.
getRealDbName
(),
db_code
:
dbCode
,
param
:
{
sConfig
:
JSON
.
stringify
(
config
),
sData
:
JSON
.
stringify
(
data
)
}
}
return
this
.
requestClient
.
post
(
WEB_QUERY
,
postData
)
return
this
.
requestClient
.
post
(
this
.
getConfigDbNameApiProxy
()
||
WEB_QUERY
,
postData
)
}
// 查询配置
/**
...
...
@@ -75,13 +102,24 @@ class Control {
*/
webChartConfigQuery
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
appCode
,
pageName
,
controlName
,
userId
,
dbName
,
dbCode
,
configType
}
=
data
const
{
appCode
,
pageName
,
controlName
,
userId
,
dbName
,
dbCode
,
configType
}
=
data
const
postData
=
{
exec_sql
:
`EXEC dbo.spappWebChartConfig_Query @sAppCode='
${
appCode
}
',@sPage='
${
pageName
}
',@sControl='
${
controlName
}
',@iUserId='
${
userId
}
',@iConfigType='
${
configType
}
'`
,
db_name
:
dbName
||
this
.
requestClient
.
get
DbName
(),
db_name
:
this
.
getReal
DbName
(),
db_code
:
dbCode
}
return
this
.
requestClient
.
post
(
WEB_QUERY_QUERY
,
postData
)
return
this
.
requestClient
.
post
(
this
.
getConfigDbNameApiProxy
()
||
WEB_QUERY_QUERY
,
postData
)
}
// 获取将要另存到本地的配置
webChartConfigSaveAs
(
data
=
{})
{
...
...
@@ -89,10 +127,13 @@ class Control {
const
{
appCode
,
pageName
,
dbName
,
dbCode
}
=
data
const
postData
=
{
exec_sql
:
`EXEC dbo.spappWebChartConfig_SaveAs @sAppCode='
${
appCode
}
',@sPage='
${
pageName
}
'`
,
db_name
:
dbName
||
this
.
requestClient
.
get
DbName
(),
db_name
:
this
.
getReal
DbName
(),
db_code
:
dbCode
}
return
this
.
requestClient
.
post
(
WEB_QUERY_QUERY_VALUE
,
postData
)
return
this
.
requestClient
.
post
(
this
.
getConfigDbNameApiProxy
()
||
WEB_QUERY_QUERY_VALUE
,
postData
)
}
// 另存配置
async
saveAsDataToLocal
(
data
=
{})
{
...
...
@@ -100,12 +141,18 @@ class Control {
const
{
appCode
,
pageName
}
=
data
const
res
=
await
this
.
webChartConfigSaveAs
(
data
)
if
(
!
res
)
return
this
.
download
(
`spappWebChartConfig_Upgrade_
${
appCode
}
_
${
pageName
}
.sql`
,
res
.
data
)
this
.
download
(
`spappWebChartConfig_Upgrade_
${
appCode
}
_
${
pageName
}
.sql`
,
res
.
data
)
}
download
(
name
,
data
)
{
var
urlObject
=
window
.
URL
||
window
.
webkitURL
||
window
var
downloadData
=
new
Blob
([
data
])
var
save_link
=
document
.
createElementNS
(
'http://www.w3.org/1999/xhtml'
,
'a'
)
var
save_link
=
document
.
createElementNS
(
'http://www.w3.org/1999/xhtml'
,
'a'
)
save_link
.
href
=
urlObject
.
createObjectURL
(
downloadData
)
save_link
.
download
=
name
this
.
fake_click
(
save_link
)
...
...
@@ -113,48 +160,81 @@ class Control {
fake_click
(
obj
)
{
var
ev
=
document
.
createEvent
(
'MouseEvents'
)
ev
.
initMouseEvent
(
'click'
,
true
,
false
,
window
,
0
,
0
,
0
,
0
,
0
,
false
,
false
,
false
,
false
,
0
,
null
'click'
,
true
,
false
,
window
,
0
,
0
,
0
,
0
,
0
,
false
,
false
,
false
,
false
,
0
,
null
)
obj
.
dispatchEvent
(
ev
)
}
// 直接执行sql语句
execSql
(
data
)
{
this
.
packParamHandle
(
data
=
{}
)
this
.
packParamHandle
(
(
data
=
{})
)
const
{
execSql
,
dbName
,
dbCode
}
=
data
const
postData
=
{
exec_sql
:
execSql
,
db_name
:
dbName
||
this
.
requestClient
.
get
DbName
(),
db_name
:
this
.
getReal
DbName
(),
db_code
:
dbCode
}
return
this
.
requestClient
.
post
(
WEB_QUERY_QUERY
,
postData
)
return
this
.
requestClient
.
post
(
this
.
getConfigDbNameApiProxy
()
||
WEB_QUERY_QUERY
,
postData
)
}
webChartConfigQueryLog
(
data
=
{})
{
this
.
packParamHandle
(
data
)
const
{
appCode
,
pageName
,
controlName
,
dbName
,
dbCode
}
=
data
const
postData
=
{
exec_sql
:
`EXEC dbo.spappWebChartConfig_QueryLog @sAppCode='
${
appCode
}
',@sPageName='
${
pageName
}
',@sControlName='
${
controlName
}
'`
,
db_name
:
dbName
||
this
.
requestClient
.
get
DbName
(),
db_name
:
this
.
getReal
DbName
(),
db_code
:
dbCode
}
return
this
.
requestClient
.
post
(
WEB_QUERY_QUERY
,
postData
)
return
this
.
requestClient
.
post
(
this
.
getConfigDbNameApiProxy
()
||
WEB_QUERY_QUERY
,
postData
)
}
webChartConfigRevert
(
data
=
{})
{
this
.
packParamHandle
(
data
)
const
{
appCode
,
pageName
,
db
Name
,
db
Code
,
controlName
,
version
}
=
data
const
{
appCode
,
pageName
,
dbCode
,
controlName
,
version
}
=
data
const
postData
=
{
exec_sql
:
`EXEC dbo.spappWebChartConfig_Revert @sAppCode='
${
appCode
}
',@sPageName='
${
pageName
}
',@sControlName='
${
controlName
}
',@iVersion='
${
version
}
'`
,
db_name
:
dbName
||
this
.
requestClient
.
get
DbName
(),
db_name
:
this
.
getReal
DbName
(),
db_code
:
dbCode
}
return
this
.
requestClient
.
post
(
WEB_QUERY
,
postData
)
return
this
.
requestClient
.
post
(
this
.
getConfigDbNameApiProxy
()
||
WEB_QUERY
,
postData
)
}
// 控件配置查询
webControlQuery
(
data
=
{})
{
this
.
packParamHandle
(
data
)
const
{
dbName
,
pageName
,
param
,
appCode
,
controlName
,
returnType
,
dbCode
,
userId
,
configType
}
=
data
const
{
dbName
,
pageName
,
param
,
appCode
,
controlName
,
returnType
,
dbCode
,
userId
,
configType
}
=
data
// 获取问号参数中的config_db_name
const
postData
=
{
db_name
:
dbName
||
this
.
requestClient
.
get
DbName
(),
db_name
:
this
.
getReal
DbName
(),
app_code
:
appCode
,
page
:
pageName
,
param
:
JSON
.
stringify
(
param
||
{}),
...
...
@@ -164,7 +244,17 @@ class Control {
user_id
:
userId
,
config_type
:
configType
}
return
this
.
requestClient
.
post
(
WEB_QUERY_PAGE
,
postData
)
return
this
.
requestClient
.
post
(
this
.
getConfigDbNameApiProxy
()
||
WEB_QUERY_PAGE
,
postData
)
}
getRealDbName
()
{
const
db_name
=
config_db_name
||
this
.
requestClient
.
getDbName
()
return
db_name
}
getConfigDbNameApiProxy
()
{
return
config_db_name
?
CONFIG_TOOL_API
:
''
}
}
export
default
Control
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