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
f9e39353
Commit
f9e39353
authored
May 11, 2021
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加上db_name
parent
d1b267cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
webChartConfig.js
src/packages/modules/webChartConfig.js
+7
-7
root.js
src/root.js
+13
-1
No files found.
src/packages/modules/webChartConfig.js
View file @
f9e39353
...
...
@@ -49,7 +49,7 @@ class Control {
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
,
db_name
:
dbName
||
this
.
requestClient
.
getDbName
()
,
db_code
:
dbCode
,
param
:
{
sConfig
:
JSON
.
stringify
(
config
),
...
...
@@ -78,7 +78,7 @@ class Control {
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
,
db_name
:
dbName
||
this
.
requestClient
.
getDbName
()
,
db_code
:
dbCode
}
return
this
.
requestClient
.
post
(
WEB_QUERY_QUERY
,
postData
)
...
...
@@ -89,7 +89,7 @@ class Control {
const
{
appCode
,
pageName
,
dbName
,
dbCode
}
=
data
const
postData
=
{
exec_sql
:
`EXEC dbo.spappWebChartConfig_SaveAs @sAppCode='
${
appCode
}
',@sPage='
${
pageName
}
'`
,
db_name
:
dbName
,
db_name
:
dbName
||
this
.
requestClient
.
getDbName
()
,
db_code
:
dbCode
}
return
this
.
requestClient
.
post
(
WEB_QUERY_QUERY_VALUE
,
postData
)
...
...
@@ -124,7 +124,7 @@ class Control {
const
{
execSql
,
dbName
,
dbCode
}
=
data
const
postData
=
{
exec_sql
:
execSql
,
db_name
:
dbName
,
db_name
:
dbName
||
this
.
requestClient
.
getDbName
()
,
db_code
:
dbCode
}
return
this
.
requestClient
.
post
(
WEB_QUERY_QUERY
,
postData
)
...
...
@@ -134,7 +134,7 @@ class Control {
const
{
appCode
,
pageName
,
controlName
,
dbName
,
dbCode
}
=
data
const
postData
=
{
exec_sql
:
`EXEC dbo.spappWebChartConfig_QueryLog @sAppCode='
${
appCode
}
',@sPageName='
${
pageName
}
',@sControlName='
${
controlName
}
'`
,
db_name
:
dbName
,
db_name
:
dbName
||
this
.
requestClient
.
getDbName
()
,
db_code
:
dbCode
}
return
this
.
requestClient
.
post
(
WEB_QUERY_QUERY
,
postData
)
...
...
@@ -144,7 +144,7 @@ class Control {
const
{
appCode
,
pageName
,
dbName
,
dbCode
,
controlName
,
version
}
=
data
const
postData
=
{
exec_sql
:
`EXEC dbo.spappWebChartConfig_Revert @sAppCode='
${
appCode
}
',@sPageName='
${
pageName
}
',@sControlName='
${
controlName
}
',@iVersion='
${
version
}
'`
,
db_name
:
dbName
,
db_name
:
dbName
||
this
.
requestClient
.
getDbName
()
,
db_code
:
dbCode
}
return
this
.
requestClient
.
post
(
WEB_QUERY
,
postData
)
...
...
@@ -154,7 +154,7 @@ class Control {
this
.
packParamHandle
(
data
)
const
{
dbName
,
pageName
,
param
,
appCode
,
controlName
,
returnType
,
dbCode
,
userId
,
configType
}
=
data
const
postData
=
{
db_name
:
dbName
,
db_name
:
dbName
||
this
.
requestClient
.
getDbName
()
,
app_code
:
appCode
,
page
:
pageName
,
param
:
JSON
.
stringify
(
param
||
{}),
...
...
src/root.js
View file @
f9e39353
import
axios
from
'axios'
import
hsUtil
from
'hs-util-js'
const
urlParam
=
hsUtil
.
SystemModule
.
getUrlParams
()
const
parseGlobalParams
=
hsUtil
.
SystemModule
.
parseGlobalParams
()
class
Root
{
constructor
(
_axios
)
{
this
.
moduleName
=
'rootModule'
...
...
@@ -31,7 +34,7 @@ class Root {
requestConfig
(
config
)
{
return
axios
(
config
)
}
handleParams
(
params
)
{
handleParams
(
params
)
{
if
(
params
)
{
delete
params
.
token
delete
params
.
_user_info
...
...
@@ -59,6 +62,11 @@ class Root {
}
}
getDbName
()
{
if
(
urlParam
.
dbName
)
return
urlParam
.
dbName
if
(
parseGlobalParams
.
db_name
)
return
parseGlobalParams
.
db_name
return
''
}
request
(
method
,
url
,
data
,
params
,
headers
=
null
,
config
=
{})
{
this
.
filterEmptyValue
(
data
)
// 公共头设置
...
...
@@ -70,6 +78,10 @@ class Root {
params
&&
(
aixosCtx
.
params
=
params
)
if
(
aixosCtx
.
params
&&
aixosCtx
.
params
.
token
)
delete
aixosCtx
.
params
.
token
if
(
aixosCtx
.
params
&&
aixosCtx
.
params
.
_user_info
)
delete
aixosCtx
.
params
.
_user_info
// 给问号参数加上db_name,逻辑是 session中没有 就去取url上的
if
(
!
aixosCtx
.
params
.
db_name
)
{
aixosCtx
.
params
.
db_name
=
this
.
getDbName
()
}
data
&&
(
aixosCtx
.
data
=
data
)
headers
&&
(
aixosCtx
.
headers
=
headers
)
const
result
=
this
.
axios
(
aixosCtx
)
...
...
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