Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-equity
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 65c4ae65
authored
Jul 13, 2021
by
liwk
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
8b01419b
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
205 additions
and
108 deletions
package-lock.json
package.json
src/api/api.js
src/api/axios.js
src/api/request.js
src/api/sign.js
src/base.js
src/components/d2-table/index.vue
src/views/tao/financialManagement/index.vue
vue.config.js
package-lock.json
View file @
65c4ae6
...
...
@@ -2669,6 +2669,11 @@
"integrity"
:
"sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I="
,
"dev"
:
true
},
"charenc"
:
{
"version"
:
"0.0.2"
,
"resolved"
:
"https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz"
,
"integrity"
:
"sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc="
},
"check-types"
:
{
"version"
:
"7.4.0"
,
"resolved"
:
"http://registry.npm.taobao.org/check-types/download/check-types-7.4.0.tgz"
,
...
...
@@ -3344,6 +3349,11 @@
"which"
:
"^1.2.9"
}
},
"crypt"
:
{
"version"
:
"0.0.2"
,
"resolved"
:
"https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz"
,
"integrity"
:
"sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs="
},
"crypto-browserify"
:
{
"version"
:
"3.12.0"
,
"resolved"
:
"http://registry.npm.taobao.org/crypto-browserify/download/crypto-browserify-3.12.0.tgz"
,
...
...
@@ -10380,6 +10390,15 @@
"safe-buffer"
:
"^5.0.1"
}
},
"sha1"
:
{
"version"
:
"1.1.1"
,
"resolved"
:
"https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz"
,
"integrity"
:
"sha1-rdqnqTFo85PxnrKxUJFhjicA+Eg="
,
"requires"
:
{
"charenc"
:
">= 0.0.1"
,
"crypt"
:
">= 0.0.1"
}
},
"shebang-command"
:
{
"version"
:
"1.2.0"
,
"resolved"
:
"http://registry.npm.taobao.org/shebang-command/download/shebang-command-1.2.0.tgz"
,
...
...
package.json
View file @
65c4ae6
...
...
@@ -13,6 +13,7 @@
"file-saver"
:
"^2.0.5"
,
"glsx-vue-common"
:
"^1.2.8"
,
"glsx-vue-components"
:
"^1.0.13"
,
"sha1"
:
"^1.1.1"
,
"vee-validate"
:
"^2.1.7"
,
"vue"
:
"^2.5.17"
,
"vue-clipboard2"
:
"^0.2.1"
,
...
...
src/api/api.js
View file @
65c4ae6
import
request
from
'./request'
export
const
orderApi
=
{
/**获取财务管理列表*/
getBalanceList
(
data
=
{})
{
return
request
(
data
,
'dj.api.get.equity.order.balance.list.get'
)
},
}
\ No newline at end of file
src/api/axios.js
0 → 100644
View file @
65c4ae6
import
axios
from
'axios'
import
Qs
from
'qs'
axios
.
defaults
.
withCredentials
=
true
let
config
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'GLSX_OSS_EQUITY_CONFIG'
))
const
baseURL
=
config
.
axios
.
baseURL
const
service
=
axios
.
create
({
baseURL
:
baseURL
,
timeout
:
60
*
1000
,
// 请求超时时间
transformRequest
:
[
function
(
data
)
{
return
Qs
.
stringify
(
data
)
}],
})
service
.
interceptors
.
request
.
use
(
config
=>
{
return
config
}
)
service
.
interceptors
.
response
.
use
(
response
=>
{
const
dataAxios
=
response
.
data
// 这个状态码是和后端约定的
const
{
code
}
=
dataAxios
// 有 code 代表这是一个后端接口 可以进行进一步的判断
if
(
code
==
-
1
)
{
// Notify({ type: 'danger', message })
return
dataAxios
}
switch
(
+
code
)
{
case
0
:
return
dataAxios
case
20
:
case
21
:
break
default
:
break
}
},
error
=>
{
console
.
log
(
error
)
console
.
log
(
baseURL
)
return
Promise
.
reject
(
error
)
})
export
default
service
\ No newline at end of file
src/api/request.js
View file @
65c4ae6
/*
* @Author: limin
* @Date: 2019-08-26 18:02:41
* @Last Modified by: chenwq
* @Last Modified time: 2020-12-22 11:54:03
*/
/
/ /
*
//
* @Author: limin
//
* @Date: 2019-08-26 18:02:41
//
* @Last Modified by: chenwq
//
* @Last Modified time: 2020-12-22 11:54:03
//
*/
// import sign from './sign'
import
RequestMethods
from
'./request.methods'
// import util from '@/libs/util.js'
//
//
import sign from './sign'
//
import RequestMethods from './request.methods'
//
//
import util from '@/libs/util.js'
const
request
=
(
params
=
{},
method
=
RequestMethods
.
GET
,
noSignAttr
=
[])
=>
{
// params.source = 'glsx'
// params.appKey = window.location.href.includes('dj.glsx.com.cn') ? 'd7ffc3346fc9a45bccaaa35300d59022' : '48e5e13229b82c1b4e6e8c96151f0637'
// 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
.
axios
.
baseURL
+
params
.
method
/**
* 调后端接口,请使用以下代码。
*/
var
reqData
=
(
method
===
RequestMethods
.
POST
)
?
{
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
// baseURL: process.env.VUE_APP_API,
// data: sign(params, noSignAttr)
data
:
params
}
:
{
// params: sign(params, noSignAttr)
params
:
params
}
return
axios
({
url
,
method
,
...
reqData
})
//
const request = (params = {}, method = RequestMethods.GET, noSignAttr = []) => {
//
// params.source = 'glsx'
//
// params.appKey = window.location.href.includes('dj.glsx.com.cn') ? 'd7ffc3346fc9a45bccaaa35300d59022' : '48e5e13229b82c1b4e6e8c96151f0637'
//
// 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.axios.baseURL + params.method
//
/**
//
* 调后端接口,请使用以下代码。
//
*/
//
var reqData = (method === RequestMethods.POST) ? {
//
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
//
// baseURL: process.env.VUE_APP_API,
//
// data: sign(params, noSignAttr)
//
data: params
//
} : {
//
// params: sign(params, noSignAttr)
//
params: params
//
}
//
return axios({
//
url,
//
method,
//
...reqData
//
})
/**
* mock,请使用以下代码。
*/
// return axios({
// url,
// method,
// params: sign(params, noSignAttr)
// })
// /**
// * mock,请使用以下代码。
// */
// // return axios({
// // url,
// // method,
// // params: sign(params, noSignAttr)
// // })
// }
// export default request
import
axios
from
'./axios'
import
sign
from
'./sign'
import
RequestMethods
from
'./request.methods'
let
config
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'GLSX_OSS_EQUITY_CONFIG'
))
const
request
=
(
params
=
{},
url
,
method
=
RequestMethods
.
POST
,
noSignAttr
=
[])
=>
{
params
.
method
=
url
.
trimStart
().
trimEnd
()
// params.source = 'h5'
params
.
source
=
'glsx'
params
.
appKey
=
config
.
axios
.
sys
.
appKey
params
.
timestamp
=
new
Date
().
getTime
()
// params.timestamp = new Date().format('yyyy-MM-dd hh:mm:ss')
params
.
v
=
'1.0.0'
params
.
format
=
'json'
params
.
locale
=
'zh_CN'
console
.
log
(
window
.
$config
)
if
(
method
==
'post'
)
{
return
axios
({
method
,
data
:
sign
(
params
,
noSignAttr
)
})
}
else
{
return
axios
({
method
,
params
:
sign
(
params
,
noSignAttr
)
})
}
}
export
default
request
export
default
request
\ No newline at end of file
src/api/sign.js
0 → 100644
View file @
65c4ae6
import
sha1
from
'sha1'
import
qs
from
'qs'
let
config
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'GLSX_OSS_EQUITY_CONFIG'
))
const
{
secret
}
=
config
.
axios
.
sys
const
sign
=
(
params
,
noSignAttr
=
[])
=>
{
delete
params
.
sign
var
objStr
=
qs
.
stringify
(
params
,
{
arrayFormat
:
'indices'
,
encode
:
false
,
allowDots
:
true
})
var
objVal
=
objStr
.
split
(
'&'
)
var
realObj
=
{}
objVal
.
forEach
(
item
=>
{
if
(
item
.
split
(
'='
)[
0
]
==
'scene'
)
{
realObj
.
scene
=
params
.
scene
}
else
{
realObj
[
item
.
split
(
'='
)[
0
]]
=
item
.
split
(
'='
)[
1
]
}
})
const
keys
=
Object
.
keys
(
realObj
).
sort
()
var
str
=
[]
var
obj
=
null
for
(
const
key
in
realObj
)
{
obj
=
realObj
[
key
]
if
(
obj
===
null
)
{
obj
=
''
}
else
if
(
typeof
obj
===
'object'
)
{
obj
=
JSON
.
stringify
(
obj
)
}
realObj
[
key
]
=
obj
}
keys
.
forEach
(
e
=>
{
!
noSignAttr
.
includes
(
e
)
&&
str
.
push
(
e
+
realObj
[
e
])
})
realObj
.
sign
=
sha1
(
secret
+
str
.
join
(
''
)
+
secret
).
toUpperCase
()
return
realObj
}
export
default
sign
\ No newline at end of file
src/base.js
View file @
65c4ae6
...
...
@@ -57,20 +57,24 @@ var mixin = {
})
}
}
const
URL
=
'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config'
const
getConfig
=
(
url
=
URL
+
'/oss_rightsAndInterests'
)
=>
{
return
new
Promise
(
resolve
=>
{
const
xhr
=
new
XMLHttpRequest
()
xhr
.
onreadystatechange
=
()
=>
{
if
(
xhr
.
readyState
===
4
&&
xhr
.
status
===
200
)
{
let
config
=
JSON
.
parse
(
xhr
.
responseText
)
window
.
localStorage
.
setItem
(
'GLSX_OSS_EQUITY_CONFIG'
,
xhr
.
responseText
)
resolve
({
'vue'
:
Vue
,
'config'
:
JSON
.
parse
(
xhr
.
responseText
)
'config'
:
config
})
}
}
xhr
.
open
(
'GET'
,
url
)
xhr
.
send
()
})
}
/* eslint-disable no-new */
...
...
@@ -81,7 +85,7 @@ const render = App => {
render
:
h
=>
h
(
App
)
})
}
getConfig
()
export
default
{
render
,
getConfig
...
...
src/components/d2-table/index.vue
View file @
65c4ae6
...
...
@@ -270,6 +270,7 @@ export default {
params
.
sort
=
this
.
sort
===
'descending'
?
1
:
0
}
// console.log(params)
console
.
log
(
1
)
this
.
getListApi
(
params
).
then
(
res
=>
{
this
.
data
=
res
[
this
.
tableParams
.
listName
]
this
.
total
=
res
.
total
...
...
src/views/tao/financialManagement/index.vue
View file @
65c4ae6
...
...
@@ -116,10 +116,7 @@
slot-scope=
"scope"
:data=
"scope.scope"
>
<el-button
type=
"text"
@
click=
"startcollectiondetails(scope.scope)"
>
查看详情
</el-button>
<el-button
type=
"text"
>
查看详情
</el-button>
</span>
<template
slot=
'custom'
>
<div
class=
"table-custom"
>
...
...
@@ -132,6 +129,7 @@
</template>
<
script
type=
'text/ecmascript-6'
>
import
{
orderApi
}
from
'@api/api'
export
default
{
name
:
''
,
data
()
{
...
...
@@ -153,59 +151,11 @@ export default {
label
:
'售后中'
,
value
:
4
}],
tableData
:
[
{
cardNo
:
'123'
,
activationCode
:
'恒河猴22'
,
memberName
:
'SS2W'
,
sn
:
1
,
updatedDate
:
'JKHSJKSH'
,
cardNoSSS
:
'SHJJKHK'
,
AAA
:
'掉接口'
,
BBB
:
'SDS1D1擦拭'
,
CCC
:
'胜多负少的'
,
DDD
:
'试胆大会'
},
{
cardNo
:
'123'
,
activationCode
:
'恒河猴22'
,
memberName
:
'SS2W'
,
sn
:
2
,
updatedDate
:
'JKHSJKSH'
,
cardNoSSS
:
'SHJJKHK'
,
AAA
:
'掉接口'
,
BBB
:
'SDS1D1擦拭'
,
CCC
:
'胜多负少的'
,
DDD
:
'试胆大会'
},
{
cardNo
:
'123'
,
activationCode
:
'恒河猴22'
,
memberName
:
'SS2W'
,
sn
:
3
,
updatedDate
:
'JKHSJKSH'
,
cardNoSSS
:
'SHJJKHK'
,
AAA
:
'掉接口'
,
BBB
:
'SDS1D1擦拭'
,
CCC
:
'胜多负少的'
,
DDD
:
'试胆大会'
},
{
cardNo
:
'123'
,
activationCode
:
'恒河猴22'
,
memberName
:
'SS2W'
,
sn
:
4
,
updatedDate
:
'JKHSJKSH'
,
cardNoSSS
:
'SHJJKHK'
,
AAA
:
'掉接口'
,
BBB
:
'SDS1D1擦拭'
,
CCC
:
'胜多负少的'
,
DDD
:
'试胆大会'
},
],
tableData
:
[],
tableParams
:
{
//
listName: 'list',
listName
:
'list'
,
showSummary
:
true
,
// getListApi: orderApi.getBalanceList,
summaryMethod
({
columns
,
data
})
{
let
sums
=
[]
columns
.
forEach
((
column
,
index
)
=>
{
...
...
@@ -213,7 +163,7 @@ export default {
sums
[
index
]
=
'合计'
return
}
const
values
=
data
.
map
(
item
=>
Number
(
item
[
column
.
property
]))
;
const
values
=
data
.
map
(
item
=>
Number
(
item
[
column
.
property
]))
if
(
!
values
.
every
(
value
=>
isNaN
(
value
)))
{
sums
[
index
]
=
values
.
reduce
((
prev
,
curr
)
=>
{
const
value
=
Number
(
curr
)
...
...
@@ -287,6 +237,9 @@ export default {
}
},
mounted
()
{
orderApi
.
getBalanceList
().
then
(
res
=>
{
console
.
log
(
res
)
})
},
methods
:
{
}
...
...
vue.config.js
View file @
65c4ae6
...
...
@@ -19,6 +19,7 @@ module.exports = {
config
.
plugins
.
delete
(
'named-chunks'
)
config
.
resolve
.
alias
.
set
(
'@a'
,
path
.
resolve
(
__dirname
,
'./src/assets'
))
.
set
(
'@api'
,
path
.
resolve
(
__dirname
,
'./src/api'
))
},
configureWebpack
:
(
config
)
=>
{
// config.devtool = (mode === 'development') ? 'inline-source-map' : false
...
...
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