Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
hrs_app_h5
/
bill
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
acecce8d
authored
Apr 23, 2020
by
cocomilk2012
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
more api
parent
fd49aae3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
19 deletions
src/api/More/index.js
src/api/More/urls.js
src/assets/js/MescrollMixins.js
src/store/modules/more.js
src/store/types.js
src/api/More/index.js
View file @
acecce8d
import
{
AjaxRequest
}
from
"../index"
;
import
urls
from
"./urls"
;
import
token
from
"../../store/modules/token"
const
usermemberId
=
token
.
state
.
usermemberId
;
console
.
log
(
'userid'
,
usermemberId
);
export
default
{
// get数据
async
getData
(
comid
,
id
,
name
)
{
const
url
=
`
${
urls
.
host
}
/
${
comid
}
/
${
urls
.
getData
}
/departments`
const
params
=
{
'param1'
:
id
,
'param2'
:
name
};
return
AjaxRequest
.
get
(
url
,
params
);
},
async
getMonth
(
comid
,
deptid
,
name
)
{
const
url
=
`
${
urls
.
host
}
/
${
comid
}
/
${
urls
.
getMonth
}
/departments`
const
params
=
{
'param1'
:
deptid
,
'param2'
:
name
};
return
AjaxRequest
.
get
(
url
,
params
);
async
getMoreList
(
comid
,
id
,
name
)
{
const
url
=
urls
.
getMoreList
(
usermemberId
);
return
AjaxRequest
.
get
(
url
);
},
async
getCycle
(
comid
,
deptid
,
name
)
{
const
url
=
`
${
urls
.
host
}
/
${
comid
}
/
${
urls
.
getCycle
}
/departments`
const
params
=
{
'param1'
:
deptid
,
'param2'
:
name
};
return
AjaxRequest
.
get
(
url
,
params
);
async
getMoreSummary
(
comid
,
deptid
,
name
)
{
const
url
=
urls
.
getMoreSummary
(
usermemberId
);
return
AjaxRequest
.
get
(
url
);
},
};
src/api/More/urls.js
View file @
acecce8d
var
VUE_APP_API_BASEURL
=
process
.
env
.
VUE_APP_API_BASEURL
export
default
{
host
:
"/host"
,
getData
:
'/getdata'
,
getMonth
:
'/getmonth'
,
getCycle
:
'/getcycle'
};
\ No newline at end of file
getMoreList
(
usermemberId
)
{
let
url
=
VUE_APP_API_BASEURL
+
'bill/account/{usermemberId}/moresvc/receipt/list'
;
url
=
url
.
replace
(
'{usermemberId}'
,
usermemberId
);
return
url
;
},
getMoreSummary
(
accountId
,
usermemberId
)
{
let
url
=
VUE_APP_API_BASEURL
+
'bill/account/{usermemberId}/moresvc/summary'
;
url
=
url
.
replace
(
'{usermemberId}'
,
usermemberId
);
return
url
;
}
};
// http://organization.test.hrs100.cn:18080/api/user/bill/account/206484/moresvc/receipt/list
// http://organization.test.hrs100.cn:18080/api/user/bill/account/206484/moresvc/summary
\ No newline at end of file
src/assets/js/MescrollMixins.js
0 → 100644
View file @
acecce8d
const
MescrollMixins
=
{
data
()
{
mescroll
:
null
},
beforeRouteEnter
(
to
,
from
,
next
)
{
// 如果没有配置回到顶部按钮或isBounce,则beforeRouteEnter不用写
next
(
vm
=>
{
// 找到当前mescroll的ref,调用子组件mescroll-vue的beforeRouteEnter方法
vm
.
$refs
.
mescroll
&&
vm
.
$refs
.
mescroll
.
beforeRouteEnter
()
// 进入路由时,滚动到原来的列表位置,恢复回到顶部按钮和isBounce的配置
})
},
beforeRouteLeave
(
to
,
from
,
next
)
{
// 如果没有配置回到顶部按钮或isBounce,则beforeRouteLeave不用写
// 找到当前mescroll的ref,调用子组件mescroll-vue的beforeRouteEnter方法
this
.
$refs
.
mescroll
&&
this
.
$refs
.
mescroll
.
beforeRouteLeave
()
// 退出路由时,记录列表滚动的位置,隐藏回到顶部按钮和isBounce的配置
next
()
}
}
export
default
MescrollMixins
src/store/modules/more.js
0 → 100644
View file @
acecce8d
import
types
from
"../types"
;
let
morelist
=
[]
const
state
=
{
morelist
}
const
getters
=
{
getMoreList
(
state
)
{
const
temp
=
localStorage
.
getItem
(
'morelist'
);
if
(
temp
)
{
state
.
morelist
=
temp
}
return
state
.
morelist
;
},
}
const
mutations
=
{
[
types
.
CHANGE_MORE_LIST
](
state
,
morelist
)
{
state
.
morelist
=
morelist
;
try
{
localStorage
.
setItem
(
"morelist"
,
morelist
);
}
catch
(
error
)
{
}
}
}
const
actions
=
{
savePeriodIndex
({
commit
},
morelist
)
{
commit
(
types
.
CHANGE_MORE_LIST
,
morelist
);
}
}
export
default
{
state
,
getters
,
mutations
,
actions
}
\ No newline at end of file
src/store/types.js
View file @
acecce8d
...
...
@@ -8,6 +8,7 @@ const CHANGE_RECEIPT_LIST = 'CHANGE_RECEIPT_LIST';
const
CHANGE_RECEIPT_DETAIL
=
'CHANGE_RECEIPT_DETAIL'
;
const
CHANGE_CURRENT_PERIOD
=
'CHANGE_CURRENT_PERIOD'
;
const
CHANGE_CURRENT_BEGINDATE
=
"CHANGE_CURRENT_BEGINDATE"
;
const
CHANGE_MORE_LIST
=
"CHANGE_MORE_LIST"
;
export
default
{
CHANGE_BILL_PERIOD
,
CHANGE_BILL_SUMMARY
,
...
...
@@ -17,5 +18,6 @@ export default {
CHANGE_RECEIPT_DETAIL
,
CHANGE_CURRENT_PERIOD
,
CHANGE_CURRENT_BEGINDATE
,
CHANGE_MORE_LIST
,
}
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