Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
Videodiagnosis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
苗家乐
Videodiagnosis
Commits
c53149d1
Commit
c53149d1
authored
Jan 22, 2024
by
miaojiale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
短信链接H5
parent
6ea0c244
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
33 deletions
+40
-33
index.js
src/axios/api/index.js
+3
-0
http.js
src/axios/request/http.js
+3
-0
questionnaire.vue
src/pages/questionnaire.vue
+10
-3
index.js
src/router/index.js
+24
-30
No files found.
src/axios/api/index.js
View file @
c53149d1
...
...
@@ -42,5 +42,8 @@ export const API = {
// 提交问卷
setQuestionnaire
:
(
data
)
=>
{
return
post
(
`/disease-data/questionnaire`
,
data
)
},
login
:
(
data
)
=>
{
return
get
(
`/cloud-auth/oauth/token?grant_type=client_credentials`
,
data
)
}
}
src/axios/request/http.js
View file @
c53149d1
...
...
@@ -28,6 +28,9 @@ axios.interceptors.request.use(
(
config
)
=>
{
config
.
data
=
config
.
data
config
.
headers
[
"
user-cookie
"
]
=
localStorage
.
getItem
(
"
vd_token
"
)
if
(
config
.
url
.
includes
(
"
oauth/token
"
))
{
config
.
headers
[
"
Authorization
"
]
=
`Bearer YXBwOmNsb3VkX2FwcA==`
}
return
config
},
(
error
)
=>
{
...
...
src/pages/questionnaire.vue
View file @
c53149d1
...
...
@@ -18,6 +18,7 @@
<
script
>
import
VForm
from
"
@/components/FormComponents
"
export
default
{
name
:
"
questionnaire
"
,
components
:
{
VForm
},
data
()
{
return
{
...
...
@@ -37,6 +38,11 @@ export default {
}
},
methods
:
{
login
()
{
this
.
$API
.
login
().
then
((
res
)
=>
{
console
.
log
(
res
)
})
},
getPatientInfo
()
{
let
params
=
{
idCard
:
111111111
,
...
...
@@ -58,9 +64,9 @@ export default {
this
.
$API
.
getQuestionnaireList
().
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
forms
=
[...
res
.
data
]
this
.
forms
.
map
((
e
)
=>
{
e
.
rules
=
[{
required
:
true
,
trigger
:
"
blur
"
,
message
:
"
该项必传
"
}]
})
//
this.forms.map((e) => {
//
e.rules = [{ required: true, trigger: "blur", message: "该项必传" }]
//
})
this
.
forms
.
push
({
type
:
"
button
"
,
...
...
@@ -119,6 +125,7 @@ export default {
}
},
created
()
{
this
.
login
()
this
.
getPatientInfo
()
this
.
getQuestionList
()
},
...
...
src/router/index.js
View file @
c53149d1
import
Vue
from
"
vue
"
;
import
Router
from
"
vue-router
"
;
Vue
.
use
(
Router
)
;
import
Vue
from
"
vue
"
import
Router
from
"
vue-router
"
Vue
.
use
(
Router
)
//登录 注册 激活
const
page
=
[
{
path
:
"
/
"
,
// redirect: "/feedback" //调试
},
{
path
:
"
/login
"
,
meta
:
{
index
:
1
,
keepAlive
:
false
},
name
:
"
login
"
,
component
:
()
=>
import
(
"
@/pages/login
"
)
redirect
:
"
/questionnaire
"
//调试
},
// {
// path: "/login",
// meta: { index: 1, keepAlive: false },
// name: "login",
// component: () => import("@/pages/login")
// },
{
path
:
`/feedback/:dataId`
,
meta
:
{
index
:
2
,
keepAlive
:
false
},
...
...
@@ -20,44 +20,38 @@ const page = [
component
:
()
=>
import
(
"
@/pages/feedback
"
)
},
{
path
:
`/questionnaire/:
dataI
d`
,
path
:
`/questionnaire/:
i
d`
,
meta
:
{
index
:
2
,
keepAlive
:
false
},
name
:
"
questionnaire
"
,
component
:
()
=>
import
(
"
@/pages/questionnaire
"
)
}
]
;
]
const
router
=
new
Router
({
// scrollBehavior: () => ({
// y: 0
// }),
routes
:
[...
page
]
})
;
})
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
if
(
from
.
meta
.
keepAlive
)
{
const
$wrapper
=
document
.
querySelector
(
"
.list_content
"
);
// 列表的外层容器 注意找到滚动的盒子
const
scrollTop
=
$wrapper
?
$wrapper
.
scrollTop
:
0
;
// console.log("scrollTop=", scrollTop);
from
.
meta
.
scrollTop
=
scrollTop
;
}
next
();
});
next
()
})
// 解决编程式路由往同一地址跳转时会报错的情况
const
originalPush
=
Router
.
prototype
.
push
;
const
originalReplace
=
Router
.
prototype
.
replace
;
const
originalPush
=
Router
.
prototype
.
push
const
originalReplace
=
Router
.
prototype
.
replace
// push
Router
.
prototype
.
push
=
function
push
(
location
,
onResolve
,
onReject
)
{
if
(
onResolve
||
onReject
)
return
originalPush
.
call
(
this
,
location
,
onResolve
,
onReject
)
;
return
originalPush
.
call
(
this
,
location
).
catch
((
err
)
=>
err
)
;
}
;
return
originalPush
.
call
(
this
,
location
,
onResolve
,
onReject
)
return
originalPush
.
call
(
this
,
location
).
catch
((
err
)
=>
err
)
}
//replace
Router
.
prototype
.
replace
=
function
push
(
location
,
onResolve
,
onReject
)
{
if
(
onResolve
||
onReject
)
return
originalReplace
.
call
(
this
,
location
,
onResolve
,
onReject
)
;
return
originalReplace
.
call
(
this
,
location
).
catch
((
err
)
=>
err
)
;
}
;
export
default
router
;
return
originalReplace
.
call
(
this
,
location
,
onResolve
,
onReject
)
return
originalReplace
.
call
(
this
,
location
).
catch
((
err
)
=>
err
)
}
export
default
router
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