Commit d691c8e8 authored by 何虹's avatar 何虹 💬

优化

parent ac0f2565
...@@ -21797,7 +21797,8 @@ __webpack_require__.r(__webpack_exports__); ...@@ -21797,7 +21797,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */ "UN_CLOSE_BILLS": function() { return /* binding */ UN_CLOSE_BILLS; }, /* harmony export */ "UN_CLOSE_BILLS": function() { return /* binding */ UN_CLOSE_BILLS; },
/* harmony export */ "SEND_BILLS": function() { return /* binding */ SEND_BILLS; }, /* harmony export */ "SEND_BILLS": function() { return /* binding */ SEND_BILLS; },
/* harmony export */ "UN_SEND_BILLS": function() { return /* binding */ UN_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 export */ });
/* harmony import */ var _commonProxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31); /* 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_ ...@@ -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 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 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 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__); ...@@ -21833,16 +21836,18 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */ "COMMON_PROXY": function() { return /* binding */ COMMON_PROXY; }, /* harmony export */ "COMMON_PROXY": function() { return /* binding */ COMMON_PROXY; },
/* harmony export */ "GQL_PROXY": function() { return /* binding */ GQL_PROXY; }, /* harmony export */ "GQL_PROXY": function() { return /* binding */ GQL_PROXY; },
/* harmony export */ "FILE_RESOURCE_PROXY": function() { return /* binding */ FILE_RESOURCE_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 */ }); /* 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 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_UTIL_PROXY = 'COMMON_UTIL_PROXY' // `http://${api}/CommonUtil/api/`
const COMMON_PROXY = 'COMMON_PROXY' // `http://${api}/` const COMMON_PROXY = 'COMMON_PROXY' // `http://${api}/`
const GQL_PROXY = 'GQL_PROXY'// `http://${api}/GQL/api/` const GQL_PROXY = 'GQL_PROXY' // `http://${api}/GQL/api/`
const FILE_RESOURCE_PROXY = 'FILE_RESOURCE_PROXY'// `http://${api}/fileresource/api/` const FILE_RESOURCE_PROXY = 'FILE_RESOURCE_PROXY' // `http://${api}/fileresource/api/`
const SERVICE_PROXY = 'SERVICE_PROXY'// `SERVICE_PROXY` const SERVICE_PROXY = 'SERVICE_PROXY' // `SERVICE_PROXY`
const CONFIG_TOOL_PROXY = 'CONFIG_TOOL_PROXY' // `新模式toolconfig`
/***/ }), /***/ }),
...@@ -21856,10 +21861,11 @@ __webpack_require__.r(__webpack_exports__); ...@@ -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__); /* 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 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 { class Control {
constructor(requestClient) { constructor (requestClient) {
console.log('WebChartConfigModule')
this.requestClient = requestClient this.requestClient = requestClient
this.moduleName = 'WebChartConfigModule' this.moduleName = 'WebChartConfigModule'
} }
...@@ -21900,19 +21906,39 @@ class Control { ...@@ -21900,19 +21906,39 @@ class Control {
* sData: 数据 * sData: 数据
* @param {*} data * @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) 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 = { 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}'`, exec_sql: `EXEC dbo.spappWebChartConfig_Save @sAppCode='${appCode}',@sPage='${pageName}',@sControl='${controlName}',@sControlType='${controlType ||
db_name: dbName || this.requestClient.getDbName(), ''}',@sConfig=:sConfig,@sData=:sData,@sQuerySql='${querySql ||
''}',@bMockData='${mockData ||
''}',@iUserId='${userId}',@iConfigType='${configType}'`,
db_name: this.getRealDbName(),
db_code: dbCode, db_code: dbCode,
param: { param: {
sConfig: JSON.stringify(config), sConfig: JSON.stringify(config),
sData: JSON.stringify(data) 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
)
} }
// 查询配置 // 查询配置
/** /**
...@@ -21931,13 +21957,24 @@ class Control { ...@@ -21931,13 +21957,24 @@ class Control {
*/ */
webChartConfigQuery (data) { webChartConfigQuery (data) {
this.packParamHandle(data) this.packParamHandle(data)
const { appCode, pageName, controlName, userId, dbName, dbCode, configType } = data const {
appCode,
pageName,
controlName,
userId,
dbName,
dbCode,
configType
} = data
const postData = { const postData = {
exec_sql: `EXEC dbo.spappWebChartConfig_Query @sAppCode='${appCode}',@sPage='${pageName}',@sControl='${controlName}',@iUserId='${userId}',@iConfigType='${configType}'`, exec_sql: `EXEC dbo.spappWebChartConfig_Query @sAppCode='${appCode}',@sPage='${pageName}',@sControl='${controlName}',@iUserId='${userId}',@iConfigType='${configType}'`,
db_name: dbName || this.requestClient.getDbName(), db_name: this.getRealDbName(),
db_code: dbCode 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 = {}) { webChartConfigSaveAs (data = {}) {
...@@ -21945,10 +21982,13 @@ class Control { ...@@ -21945,10 +21982,13 @@ class Control {
const { appCode, pageName, dbName, dbCode } = data const { appCode, pageName, dbName, dbCode } = data
const postData = { const postData = {
exec_sql: `EXEC dbo.spappWebChartConfig_SaveAs @sAppCode='${appCode}',@sPage='${pageName}'`, exec_sql: `EXEC dbo.spappWebChartConfig_SaveAs @sAppCode='${appCode}',@sPage='${pageName}'`,
db_name: dbName || this.requestClient.getDbName(), db_name: this.getRealDbName(),
db_code: dbCode 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 = {}) { async saveAsDataToLocal (data = {}) {
...@@ -21956,12 +21996,18 @@ class Control { ...@@ -21956,12 +21996,18 @@ class Control {
const { appCode, pageName } = data const { appCode, pageName } = data
const res = await this.webChartConfigSaveAs(data) const res = await this.webChartConfigSaveAs(data)
if (!res) return if (!res) return
this.download(`spappWebChartConfig_Upgrade_${appCode}_${pageName}.sql`, res.data) this.download(
`spappWebChartConfig_Upgrade_${appCode}_${pageName}.sql`,
res.data
)
} }
download (name, data) { download (name, data) {
var urlObject = window.URL || window.webkitURL || window var urlObject = window.URL || window.webkitURL || window
var downloadData = new Blob([data]) 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.href = urlObject.createObjectURL(downloadData)
save_link.download = name save_link.download = name
this.fake_click(save_link) this.fake_click(save_link)
...@@ -21969,48 +22015,81 @@ class Control { ...@@ -21969,48 +22015,81 @@ class Control {
fake_click (obj) { fake_click (obj) {
var ev = document.createEvent('MouseEvents') var ev = document.createEvent('MouseEvents')
ev.initMouseEvent( ev.initMouseEvent(
'click', true, false, window, 0, 0, 0, 0, 0 'click',
, false, false, false, false, 0, null true,
false,
window,
0,
0,
0,
0,
0,
false,
false,
false,
false,
0,
null
) )
obj.dispatchEvent(ev) obj.dispatchEvent(ev)
} }
// 直接执行sql语句 // 直接执行sql语句
execSql (data) { execSql (data) {
this.packParamHandle(data = {}) this.packParamHandle((data = {}))
const { execSql, dbName, dbCode } = data const { execSql, dbName, dbCode } = data
const postData = { const postData = {
exec_sql: execSql, exec_sql: execSql,
db_name: dbName || this.requestClient.getDbName(), db_name: this.getRealDbName(),
db_code: dbCode 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 = {}) { webChartConfigQueryLog (data = {}) {
this.packParamHandle(data) this.packParamHandle(data)
const { appCode, pageName, controlName, dbName, dbCode } = data const { appCode, pageName, controlName, dbName, dbCode } = data
const postData = { const postData = {
exec_sql: `EXEC dbo.spappWebChartConfig_QueryLog @sAppCode='${appCode}',@sPageName='${pageName}',@sControlName='${controlName}'`, exec_sql: `EXEC dbo.spappWebChartConfig_QueryLog @sAppCode='${appCode}',@sPageName='${pageName}',@sControlName='${controlName}'`,
db_name: dbName || this.requestClient.getDbName(), db_name: this.getRealDbName(),
db_code: dbCode 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 = {}) { webChartConfigRevert (data = {}) {
this.packParamHandle(data) this.packParamHandle(data)
const { appCode, pageName, dbName, dbCode, controlName, version } = data const { appCode, pageName, dbCode, controlName, version } = data
const postData = { const postData = {
exec_sql: `EXEC dbo.spappWebChartConfig_Revert @sAppCode='${appCode}',@sPageName='${pageName}',@sControlName='${controlName}',@iVersion='${version}'`, exec_sql: `EXEC dbo.spappWebChartConfig_Revert @sAppCode='${appCode}',@sPageName='${pageName}',@sControlName='${controlName}',@iVersion='${version}'`,
db_name: dbName || this.requestClient.getDbName(), db_name: this.getRealDbName(),
db_code: dbCode 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 = {}) { webControlQuery (data = {}) {
this.packParamHandle(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 = { const postData = {
db_name: dbName || this.requestClient.getDbName(), db_name: this.getRealDbName(),
app_code: appCode, app_code: appCode,
page: pageName, page: pageName,
param: JSON.stringify(param || {}), param: JSON.stringify(param || {}),
...@@ -22020,7 +22099,17 @@ class Control { ...@@ -22020,7 +22099,17 @@ class Control {
user_id: userId, user_id: userId,
config_type: configType 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); /* harmony default export */ __webpack_exports__["default"] = (Control);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -6,4 +6,4 @@ export const COMMON_PROXY = 'COMMON_PROXY' // `http://${api}/` ...@@ -6,4 +6,4 @@ export const COMMON_PROXY = 'COMMON_PROXY' // `http://${api}/`
export const GQL_PROXY = 'GQL_PROXY' // `http://${api}/GQL/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 FILE_RESOURCE_PROXY = 'FILE_RESOURCE_PROXY' // `http://${api}/fileresource/api/`
export const SERVICE_PROXY = 'SERVICE_PROXY' // `SERVICE_PROXY` 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`
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment