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
d691c8e8
Commit
d691c8e8
authored
Dec 06, 2021
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
ac0f2565
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
151 additions
and
62 deletions
+151
-62
hsWebHttpClient.js
dist/hsWebHttpClient.js
+149
-60
hsWebHttpClient.min.js
dist/hsWebHttpClient.min.js
+1
-1
commonProxy.js
src/packages/common/commonProxy.js
+1
-1
No files found.
dist/hsWebHttpClient.js
View file @
d691c8e8
...
...
@@ -21797,7 +21797,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */
"UN_CLOSE_BILLS"
:
function
()
{
return
/* binding */
UN_CLOSE_BILLS
;
},
/* harmony export */
"SEND_BILLS"
:
function
()
{
return
/* binding */
SEND_BILLS
;
},
/* harmony export */
"UN_SEND_BILLS"
:
function
()
{
return
/* binding */
UN_SEND_BILLS
;
},
/* harmony export */
"REJECT_BILLS"
:
function
()
{
return
/* binding */
REJECT_BILLS
;
}
/* harmony export */
"REJECT_BILLS"
:
function
()
{
return
/* binding */
REJECT_BILLS
;
},
/* harmony export */
"CONFIG_TOOL_API"
:
function
()
{
return
/* binding */
CONFIG_TOOL_API
;
}
/* harmony export */
});
/* harmony import */
var
_commonProxy__WEBPACK_IMPORTED_MODULE_0__
=
__webpack_require__
(
31
);
...
...
@@ -21817,6 +21818,8 @@ const UN_CLOSE_BILLS = `${_commonProxy__WEBPACK_IMPORTED_MODULE_0__.COMMON_UTIL_
const
SEND_BILLS
=
`
${
_commonProxy__WEBPACK_IMPORTED_MODULE_0__
.
COMMON_UTIL_PROXY
}
/send_bills/`
const
UN_SEND_BILLS
=
`
${
_commonProxy__WEBPACK_IMPORTED_MODULE_0__
.
COMMON_UTIL_PROXY
}
/un_send_bills/`
const
REJECT_BILLS
=
`
${
_commonProxy__WEBPACK_IMPORTED_MODULE_0__
.
COMMON_UTIL_PROXY
}
/reject_bills/`
const
CONFIG_TOOL_API
=
`
${
_commonProxy__WEBPACK_IMPORTED_MODULE_0__
.
COMMON_UTIL_PROXY
}
/`
/***/
}),
...
...
@@ -21833,16 +21836,18 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */
"COMMON_PROXY"
:
function
()
{
return
/* binding */
COMMON_PROXY
;
},
/* harmony export */
"GQL_PROXY"
:
function
()
{
return
/* binding */
GQL_PROXY
;
},
/* harmony export */
"FILE_RESOURCE_PROXY"
:
function
()
{
return
/* binding */
FILE_RESOURCE_PROXY
;
},
/* harmony export */
"SERVICE_PROXY"
:
function
()
{
return
/* binding */
SERVICE_PROXY
;
}
/* harmony export */
"SERVICE_PROXY"
:
function
()
{
return
/* binding */
SERVICE_PROXY
;
},
/* harmony export */
"CONFIG_TOOL_PROXY"
:
function
()
{
return
/* binding */
CONFIG_TOOL_PROXY
;
}
/* harmony export */
});
const
OAUTH_PROXY
=
'OAUTH_PROXY'
// `http://${api}/HSRight/api/`
const
OAUTH_PROXY
=
'OAUTH_PROXY'
// `http://${api}/HSRight/api/`
const
TOOL_PROXY
=
'TOOL_PROXY'
// `http://${api}/Tool/api/`
const
HSRIGHT_TOOL_PROXY
=
'HSRIGHT_TOOL_PROXY'
// `http://${api}/HSRightTool/api/`
const
HSRIGHT_TOOL_PROXY
=
'HSRIGHT_TOOL_PROXY'
// `http://${api}/HSRightTool/api/`
const
COMMON_UTIL_PROXY
=
'COMMON_UTIL_PROXY'
// `http://${api}/CommonUtil/api/`
const
COMMON_PROXY
=
'COMMON_PROXY'
// `http://${api}/`
const
GQL_PROXY
=
'GQL_PROXY'
// `http://${api}/GQL/api/`
const
FILE_RESOURCE_PROXY
=
'FILE_RESOURCE_PROXY'
// `http://${api}/fileresource/api/`
const
SERVICE_PROXY
=
'SERVICE_PROXY'
// `SERVICE_PROXY`
const
GQL_PROXY
=
'GQL_PROXY'
// `http://${api}/GQL/api/`
const
FILE_RESOURCE_PROXY
=
'FILE_RESOURCE_PROXY'
// `http://${api}/fileresource/api/`
const
SERVICE_PROXY
=
'SERVICE_PROXY'
// `SERVICE_PROXY`
const
CONFIG_TOOL_PROXY
=
'CONFIG_TOOL_PROXY'
// `新模式toolconfig`
/***/
}),
...
...
@@ -21856,10 +21861,11 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */
var
hs_util_js__WEBPACK_IMPORTED_MODULE_1___default
=
/*#__PURE__*/
__webpack_require__
.
n
(
hs_util_js__WEBPACK_IMPORTED_MODULE_1__
);
const
urlParam
=
hs_util_js__WEBPACK_IMPORTED_MODULE_1___default
().
SystemModule
.
getUrlParams
()
const
config_db_name
=
hs_util_js__WEBPACK_IMPORTED_MODULE_1___default
().
SystemModule
.
getURLParameters
().
config_db_name
class
Control
{
constructor
(
requestClient
)
{
constructor
(
requestClient
)
{
console
.
log
(
'WebChartConfigModule'
)
this
.
requestClient
=
requestClient
this
.
moduleName
=
'WebChartConfigModule'
}
...
...
@@ -21887,57 +21893,88 @@ class Control {
}
// 保存控件配置
/**
* sAppCode:页面appCode
* sPage:页面名称
* sControl:控件名称
* sControlType: 类型
* sQuerySql: sql语句
* bMockData: 是否是模拟数据
* iUserId:用户id
* db_name: 数据库名
* db_code:数据库code
* sConfig:控件配置
* sData: 数据
* @param {*} data
*/
webChartConfigSave
(
param
)
{
// routerParms: page路由 position位置 other参数, sConfig 配置json sData 数据json
* sAppCode:页面appCode
* sPage:页面名称
* sControl:控件名称
* sControlType: 类型
* sQuerySql: sql语句
* bMockData: 是否是模拟数据
* iUserId:用户id
* db_name: 数据库名
* db_code:数据库code
* sConfig:控件配置
* sData: 数据
* @param {*} data
*/
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
(
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
WEB_QUERY
,
postData
)
return
this
.
requestClient
.
post
(
this
.
getConfigDbNameApiProxy
()
||
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
WEB_QUERY
,
postData
)
}
// 查询配置
/**
* sAppCode:页面appCode
* sPage:页面名称
* sControl:控件名称
* sControlType: 类型
* sQuerySql: sql语句
* bMockData: 是否是模拟数据
* iUserId:用户id
* db_name: 数据库名
* db_code:数据库code
* sConfig:控件配置
* sData: 数据
* @param {*} data
*/
* sAppCode:页面appCode
* sPage:页面名称
* sControl:控件名称
* sControlType: 类型
* sQuerySql: sql语句
* bMockData: 是否是模拟数据
* iUserId:用户id
* db_name: 数据库名
* db_code:数据库code
* sConfig:控件配置
* sData: 数据
* @param {*} data
*/
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
(
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
WEB_QUERY_QUERY
,
postData
)
return
this
.
requestClient
.
post
(
this
.
getConfigDbNameApiProxy
()
||
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
WEB_QUERY_QUERY
,
postData
)
}
// 获取将要另存到本地的配置
webChartConfigSaveAs
(
data
=
{})
{
...
...
@@ -21945,10 +21982,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
(
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
WEB_QUERY_QUERY_VALUE
,
postData
)
return
this
.
requestClient
.
post
(
this
.
getConfigDbNameApiProxy
()
||
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
WEB_QUERY_QUERY_VALUE
,
postData
)
}
// 另存配置
async
saveAsDataToLocal
(
data
=
{})
{
...
...
@@ -21956,12 +21996,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
)
...
...
@@ -21969,48 +22015,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
(
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
WEB_QUERY_QUERY
,
postData
)
return
this
.
requestClient
.
post
(
this
.
getConfigDbNameApiProxy
()
||
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
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
(
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
WEB_QUERY_QUERY
,
postData
)
return
this
.
requestClient
.
post
(
this
.
getConfigDbNameApiProxy
()
||
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
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
(
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
WEB_QUERY
,
postData
)
return
this
.
requestClient
.
post
(
this
.
getConfigDbNameApiProxy
()
||
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
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
||
{}),
...
...
@@ -22020,7 +22099,17 @@ class Control {
user_id
:
userId
,
config_type
:
configType
}
return
this
.
requestClient
.
post
(
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
WEB_QUERY_PAGE
,
postData
)
return
this
.
requestClient
.
post
(
this
.
getConfigDbNameApiProxy
()
||
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
WEB_QUERY_PAGE
,
postData
)
}
getRealDbName
()
{
const
db_name
=
config_db_name
||
this
.
requestClient
.
getDbName
()
return
db_name
}
getConfigDbNameApiProxy
()
{
return
config_db_name
?
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
CONFIG_TOOL_API
:
''
}
}
/* harmony default export */
__webpack_exports__
[
"default"
]
=
(
Control
);
...
...
dist/hsWebHttpClient.min.js
View file @
d691c8e8
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/packages/common/commonProxy.js
View file @
d691c8e8
...
...
@@ -6,4 +6,4 @@ 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
SERVICE
_PROXY
=
'CONFIG_TOOL_PROXY'
// `新模式toolconfig`
export
const
CONFIG_TOOL
_PROXY
=
'CONFIG_TOOL_PROXY'
// `新模式toolconfig`
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