Commit 018678a4 authored by 何虹's avatar 何虹 💬

isQueryMaster

parent 24e995f7
...@@ -13,15 +13,18 @@ class RestFul { ...@@ -13,15 +13,18 @@ class RestFul {
} }
query (data) { query (data) {
this.packParamHandle(data) this.packParamHandle(data)
const { tableName, appCode, group, parms, bodyData } = data const { tableName, appCode, group, parms, bodyData, isQueryMaster } = data
let url = `${TOOL_API}${appCode}/${tableName}/` let url = `${TOOL_API}${appCode}/${tableName}/`
if (group) { // 非标准保存 if (group) { // 非标准保存
url = `${url}${group}/` url = `${url}${group}/`
} }
const header = {
isQueryMaster: isQueryMaster ? 1 : 0
}
if (bodyData) { if (bodyData) {
return this.requestClient.pust(url, bodyData, parms) return this.requestClient.put(url, bodyData, parms, header)
} else { } else {
return this.requestClient.get(url, parms) return this.requestClient.get(url, parms, header)
} }
} }
save (data) { save (data) {
...@@ -35,38 +38,47 @@ class RestFul { ...@@ -35,38 +38,47 @@ class RestFul {
} }
queryOne (data) { queryOne (data) {
this.packParamHandle(data) this.packParamHandle(data)
const { tableName, id, appCode, parms, group, bodyData } = data const { tableName, id, appCode, parms, group, bodyData, isQueryMaster } = data
let url_ = `${TOOL_API}${appCode}/${tableName}/${id}/` let url_ = `${TOOL_API}${appCode}/${tableName}/${id}/`
if (group) { if (group) {
url_ = `${url_}${group}/` url_ = `${url_}${group}/`
} }
const header = {
isQueryMaster: isQueryMaster ? 1 : 0
}
if (bodyData) { if (bodyData) {
return this.requestClient.put(url_, bodyData, parms) return this.requestClient.put(url_, bodyData, parms, header)
} else { } else {
return this.requestClient.get(url_, parms) return this.requestClient.get(url_, parms, header)
} }
} }
put (data) { put (data) {
this.packParamHandle(data) this.packParamHandle(data)
const { tableName, appCode, bodyData, group, parms } = data const { tableName, appCode, bodyData, group, parms, isQueryMaster } = data
let url = `${TOOL_API}${appCode}/${tableName}/` let url = `${TOOL_API}${appCode}/${tableName}/`
if (group) { // 非标准保存 if (group) { // 非标准保存
url = `${url}${group}/` url = `${url}${group}/`
} }
return this.requestClient.put(url, bodyData, parms) return this.requestClient.put(url, bodyData, parms, {
isQueryMaster: isQueryMaster ? 1 : 0
})
} }
queryList (data) { queryList (data) {
this.packParamHandle(data) this.packParamHandle(data)
const { tableName, appCode, parms, group, bodyData } = data const { tableName, appCode, parms, group, bodyData, isQueryMaster } = data
let url_ = `${TOOL_API}${appCode}/${tableName}/` let url_ = `${TOOL_API}${appCode}/${tableName}/`
if (group) { if (group) {
url_ = `${url_}${group}/` url_ = `${url_}${group}/`
} }
parms.fuzzy = 1 parms.fuzzy = 1
const header = {
isQueryMaster: isQueryMaster ? 1 : 0
}
if (bodyData) { if (bodyData) {
return this.requestClient.put(url_, bodyData, parms) return this.requestClient.put(url_, bodyData, parms, header)
} else { } else {
return this.requestClient.get(url_, parms) return this.requestClient.get(url_, parms, header)
} }
} }
deleteList (data) { deleteList (data) {
......
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