Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7720e48d
authored
Sep 12, 2024
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
平板配置接口
1 parent
ae12efc0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
172 additions
and
130 deletions
public/menuIcon/packageConfig.png
src/api/contentManager.js
src/api/request.js
src/views/contentManager/packageConfig/components/addDialog.vue
src/views/contentManager/packageConfig/edit.vue
src/views/contentManager/packageConfig/index.vue
public/menuIcon/packageConfig.png
0 → 100644
View file @
7720e48
356 Bytes
src/api/contentManager.js
View file @
7720e48
...
...
@@ -101,3 +101,20 @@ export function contentManagerTaskById(data) {
data
.
method
=
`dj.api.smartcarlife.contentManagerTask.getById`
return
request
(
data
,
"POST"
)
}
// 查询接待素材商户配置
export
function
materialPage
(
data
)
{
data
.
method
=
`dj.api.smartcarlife.recepiton.material.page`
return
request
(
data
,
"POST"
,
[],
""
,
"/rop-dj-car-boutique/router"
)
}
// 查询门店接待素材详情
export
function
materialDetail
(
data
)
{
data
.
method
=
`dj.api.smartcarlife.recepiton.material.merchant.detail`
return
request
(
data
,
"POST"
,
[],
""
,
"/rop-dj-car-boutique/router"
)
}
// 保存更新门店接待素材
export
function
recepitonUpdate
(
data
)
{
data
.
method
=
`dj.api.smartcarlife.recepiton.material.merchant.saveOrUpdate`
return
request
(
data
,
"POST"
,
[],
""
,
"/rop-dj-car-boutique/router"
)
}
src/api/request.js
View file @
7720e48
/*
* @Author: limin
* @Date: 2019-08-26 18:02:41
* @Last Modified by: chenwq
* @Last Modified time: 2021-06-30 14:30:41
*/
// import axios from "@/plugin/axios"
import
axios
from
"@/plugin/axios/index_code"
import
sign
from
"./sign"
import
RequestMethods
from
"./request.methods"
import
util
from
"@/libs/util.js"
import
{
baseConfig
}
from
"@/main"
import
axiosPackage
from
"axios"
const
request
=
(
params
=
{},
method
=
RequestMethods
.
GET
,
noSignAttr
=
[],
options
)
=>
{
// 兼容线上dj和scrm appkey和secret不一样的情况
let
apiName
=
""
if
(
params
.
method
.
includes
(
"dj"
))
{
apiName
=
"dj"
}
else
{
apiName
=
params
.
method
.
split
(
".api"
)[
0
]
}
// console.log("params.method", params.method)
// console.log("apiName", apiName)
// 为空报错
if
(
!
apiName
)
{
throw
new
Error
(
"apiName is null"
)
}
const
mappingName
=
{
"dj.smartcarlife"
:
"axios"
,
dj
:
"axios"
,
scrm
:
"axios2"
,
merchants
:
"axios3"
,
reportExport
:
"axios4"
,
"glsx.accounts.biz.common.pictureUpload"
:
"common"
}
const
baseApiName
=
mappingName
[
apiName
]
// console.log(baseApiName, "baseApiName")
// params.appKey = baseConfig[baseApiName].appkey
if
(
baseApiName
==
"common"
)
{
params
.
app_key
=
baseConfig
[
baseApiName
].
appkey
}
else
{
params
.
appKey
=
baseConfig
[
baseApiName
].
appkey
}
// console.log("params.appKey", params.appKey)
params
.
timestamp
=
new
Date
().
getTime
()
params
.
v
=
"1.0.0"
params
.
format
=
"json"
params
.
locale
=
"zh_CN"
if
(
params
.
method
!==
"dj.api.user.login"
)
{
params
.
sessionId
=
util
.
cookies
.
get
(
"token"
)
}
/**
* mock - url = params.method
* 调后端接口 - url = ''
*/
const
url
=
baseConfig
[
baseApiName
].
baseURL
// const url = "/api"
/**
* 调后端接口,请使用以下代码。
*/
const
signWay
=
{
"dj.smartcarlife"
:
"sha1"
,
dj
:
"sha1"
,
scrm
:
"sha1"
,
glsx
:
"md5"
,
"glsx.accounts.biz.common.pictureUpload"
:
"md5"
}
// console.log(signWay[apiName], "baseApiName")
const
secret
=
baseConfig
[
baseApiName
].
secret
const
CancelToken
=
axiosPackage
.
CancelToken
var
reqData
=
method
===
RequestMethods
.
POST
?
{
baseURL
:
"/"
,
data
:
sign
(
params
,
noSignAttr
,
secret
,
signWay
[
apiName
])
}
:
{
params
:
sign
(
params
,
noSignAttr
,
secret
,
signWay
[
apiName
])
}
reqData
=
reqData
=
Object
.
assign
(
reqData
,
options
,
{})
// 请求进度
if
(
params
?.
onProcess
)
{
reqData
.
onUploadProgress
=
params
.
onProcess
}
// 取消请求
if
(
params
?.
cancelFun
)
{
reqData
.
cancelToken
=
new
CancelToken
(
function
excutor
(
c
)
{
params
.
cancelFun
.
cancel
=
c
})
}
// console.log(method === RequestMethods.POST)
// console.log(url)
// console.log(options)
// console.log(reqData)
return
axios
({
url
,
method
,
...
reqData
})
/**
* mock,请使用以下代码。
*/
// return axios({
// url,
// method,
// params: sign(params, noSignAttr)
// })
}
export
default
request
/*
* @Author: limin
* @Date: 2019-08-26 18:02:41
* @Last Modified by: chenwq
* @Last Modified time: 2021-06-30 14:30:41
*/
// import axios from "@/plugin/axios"
import
axios
from
"@/plugin/axios/index_code"
import
sign
from
"./sign"
import
RequestMethods
from
"./request.methods"
import
util
from
"@/libs/util.js"
import
{
baseConfig
}
from
"@/main"
import
axiosPackage
from
"axios"
const
request
=
(
params
=
{},
method
=
RequestMethods
.
GET
,
noSignAttr
=
[],
options
,
rop
)
=>
{
// 兼容线上dj和scrm appkey和secret不一样的情况
let
apiName
=
""
if
(
params
.
method
.
includes
(
"dj"
))
{
apiName
=
"dj"
}
else
{
apiName
=
params
.
method
.
split
(
".api"
)[
0
]
}
// console.log("params.method", params.method)
// console.log("apiName", apiName)
// 为空报错
if
(
!
apiName
)
{
throw
new
Error
(
"apiName is null"
)
}
const
mappingName
=
{
"dj.smartcarlife"
:
"axios"
,
dj
:
"axios"
,
scrm
:
"axios2"
,
merchants
:
"axios3"
,
reportExport
:
"axios4"
,
"glsx.accounts.biz.common.pictureUpload"
:
"common"
}
const
baseApiName
=
mappingName
[
apiName
]
// console.log(baseApiName, "baseApiName")
// params.appKey = baseConfig[baseApiName].appkey
if
(
baseApiName
==
"common"
)
{
params
.
app_key
=
baseConfig
[
baseApiName
].
appkey
}
else
{
params
.
appKey
=
baseConfig
[
baseApiName
].
appkey
}
// console.log("params.appKey", params.appKey)
params
.
timestamp
=
new
Date
().
getTime
()
params
.
v
=
"1.0.0"
params
.
format
=
"json"
params
.
locale
=
"zh_CN"
if
(
params
.
method
!==
"dj.api.user.login"
)
{
params
.
sessionId
=
util
.
cookies
.
get
(
"token"
)
}
/**
* mock - url = params.method
* 调后端接口 - url = ''
*/
let
url
=
baseConfig
[
baseApiName
].
baseURL
console
.
log
(
url
,
"url"
,
rop
)
if
(
rop
)
{
url
=
url
.
replace
(
/
\/[^\/]
+
\/[^\/]
+$/
,
rop
)
}
// const url = "/api"
/**
* 调后端接口,请使用以下代码。
*/
const
signWay
=
{
"dj.smartcarlife"
:
"sha1"
,
dj
:
"sha1"
,
scrm
:
"sha1"
,
glsx
:
"md5"
,
"glsx.accounts.biz.common.pictureUpload"
:
"md5"
}
// console.log(signWay[apiName], "baseApiName")
const
secret
=
baseConfig
[
baseApiName
].
secret
const
CancelToken
=
axiosPackage
.
CancelToken
var
reqData
=
method
===
RequestMethods
.
POST
?
{
baseURL
:
"/"
,
data
:
sign
(
params
,
noSignAttr
,
secret
,
signWay
[
apiName
])
}
:
{
params
:
sign
(
params
,
noSignAttr
,
secret
,
signWay
[
apiName
])
}
reqData
=
reqData
=
Object
.
assign
(
reqData
,
options
,
{})
// 请求进度
if
(
params
?.
onProcess
)
{
reqData
.
onUploadProgress
=
params
.
onProcess
}
// 取消请求
if
(
params
?.
cancelFun
)
{
reqData
.
cancelToken
=
new
CancelToken
(
function
excutor
(
c
)
{
params
.
cancelFun
.
cancel
=
c
})
}
// console.log(method === RequestMethods.POST)
// console.log(url)
// console.log(options)
// console.log(reqData)
return
axios
({
url
,
method
,
...
reqData
})
/**
* mock,请使用以下代码。
*/
// return axios({
// url,
// method,
// params: sign(params, noSignAttr)
// })
}
export
default
request
src/views/contentManager/packageConfig/components/addDialog.vue
View file @
7720e48
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-09-06 09:49:46
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-09-12 13:51:32
* @FilePath: \dj-car-life-system\src\views\contentManager\packageConfig\components\addDialog.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!-- 月度库存结算单弹窗 -->
<
template
>
<d2-dialog
...
...
@@ -13,38 +21,41 @@
</div>
<el-select
class=
"form-select"
v-model=
"formData.
scene
"
v-model=
"formData.
merchantId
"
placeholder=
"请选择"
>
<el-option
v-for=
"(i, indx) in
scene
List"
:key=
"i
ndx
"
:label=
"i.
label
"
:value=
"i.
i
d"
v-for=
"(i, indx) in
merchant
List"
:key=
"i
.merchantId
"
:label=
"i.
merchantName
"
:value=
"i.
merchantI
d"
></el-option>
</el-select>
</d2-dialog>
</
template
>
<
script
>
import
{
recepitonUpdate
}
from
"@api/contentManager"
export
default
{
name
:
"addDialog"
,
data
()
{
return
{
sceneList
:
[
{
label
:
"1"
,
id
:
"1"
}
],
formData
:
{}
}
},
props
:
{
dialogVisible
:
Boolean
dialogVisible
:
Boolean
,
merchantList
:
{
type
:
Object
,
default
:
()
=>
[]
}
},
methods
:
{
handleConfirm
()
{
const
{
merchantId
}
=
this
.
formData
recepitonUpdate
({
merchantId
}).
then
((
res
)
=>
{
console
.
log
(
res
)
})
this
.
handleClose
()
},
handleClose
()
{
...
...
src/views/contentManager/packageConfig/edit.vue
View file @
7720e48
This diff is collapsed.
Click to expand it.
src/views/contentManager/packageConfig/index.vue
View file @
7720e48
...
...
@@ -43,6 +43,7 @@
<add-dialog
:dialogVisible=
"dialogVisible"
v-if=
"dialogVisible"
:merchantList=
"merchantList"
@
dialogClose=
"addDialogClose"
/>
</div>
...
...
@@ -50,7 +51,7 @@
<
script
>
import
{
deepClone
}
from
"@/common/util"
import
{
contentManagerTaskPage
}
from
"@api/contentManager"
import
{
materialPage
,
getMerchantList
}
from
"@api/contentManager"
import
addDialog
from
"./components/addDialog"
export
default
{
name
:
"StaffMassSendingIndex"
,
...
...
@@ -83,7 +84,7 @@ export default {
isClear
:
true
}
],
getListApi
:
contentManagerTask
Page
,
getListApi
:
material
Page
,
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
listName
:
"list"
,
...
...
@@ -116,8 +117,16 @@ export default {
}
}
},
mounted
()
{
this
.
getMerchantList
()
},
methods
:
{
getMerchantList
()
{
var
params
=
{
currentPage
:
1
,
pageSize
:
2000
}
getMerchantList
(
params
).
then
((
res
)
=>
{
this
.
merchantList
=
res
||
[]
})
},
beforeSearchFn
()
{
return
new
Promise
((
resolve
)
=>
{
this
.
searchFormSearch
=
deepClone
(
this
.
searchForm
)
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment