Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
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
1 year ago
by
miaojiale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
短信链接H5
parent
6ea0c244
wenrenmin
No related merge requests found
Changes
4
Show 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 = {
...
@@ -42,5 +42,8 @@ export const API = {
// 提交问卷
// 提交问卷
setQuestionnaire
:
(
data
)
=>
{
setQuestionnaire
:
(
data
)
=>
{
return
post
(
`/disease-data/questionnaire`
,
data
)
return
post
(
`/disease-data/questionnaire`
,
data
)
},
login
:
(
data
)
=>
{
return
get
(
`/cloud-auth/oauth/token?grant_type=client_credentials`
,
data
)
}
}
}
}
This diff is collapsed.
Click to expand it.
src/axios/request/http.js
View file @
c53149d1
...
@@ -28,6 +28,9 @@ axios.interceptors.request.use(
...
@@ -28,6 +28,9 @@ axios.interceptors.request.use(
(
config
)
=>
{
(
config
)
=>
{
config
.
data
=
config
.
data
config
.
data
=
config
.
data
config
.
headers
[
"
user-cookie
"
]
=
localStorage
.
getItem
(
"
vd_token
"
)
config
.
headers
[
"
user-cookie
"
]
=
localStorage
.
getItem
(
"
vd_token
"
)
if
(
config
.
url
.
includes
(
"
oauth/token
"
))
{
config
.
headers
[
"
Authorization
"
]
=
`Bearer YXBwOmNsb3VkX2FwcA==`
}
return
config
return
config
},
},
(
error
)
=>
{
(
error
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/pages/questionnaire.vue
View file @
c53149d1
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
<
script
>
<
script
>
import
VForm
from
"
@/components/FormComponents
"
import
VForm
from
"
@/components/FormComponents
"
export
default
{
export
default
{
name
:
"
questionnaire
"
,
components
:
{
VForm
},
components
:
{
VForm
},
data
()
{
data
()
{
return
{
return
{
...
@@ -37,6 +38,11 @@ export default {
...
@@ -37,6 +38,11 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
login
()
{
this
.
$API
.
login
().
then
((
res
)
=>
{
console
.
log
(
res
)
})
},
getPatientInfo
()
{
getPatientInfo
()
{
let
params
=
{
let
params
=
{
idCard
:
111111111
,
idCard
:
111111111
,
...
@@ -58,9 +64,9 @@ export default {
...
@@ -58,9 +64,9 @@ export default {
this
.
$API
.
getQuestionnaireList
().
then
((
res
)
=>
{
this
.
$API
.
getQuestionnaireList
().
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
if
(
res
.
code
==
1
)
{
this
.
forms
=
[...
res
.
data
]
this
.
forms
=
[...
res
.
data
]
this
.
forms
.
map
((
e
)
=>
{
//
this.forms.map((e) => {
e
.
rules
=
[{
required
:
true
,
trigger
:
"
blur
"
,
message
:
"
该项必传
"
}]
//
e.rules = [{ required: true, trigger: "blur", message: "该项必传" }]
})
//
})
this
.
forms
.
push
({
this
.
forms
.
push
({
type
:
"
button
"
,
type
:
"
button
"
,
...
@@ -119,6 +125,7 @@ export default {
...
@@ -119,6 +125,7 @@ export default {
}
}
},
},
created
()
{
created
()
{
this
.
login
()
this
.
getPatientInfo
()
this
.
getPatientInfo
()
this
.
getQuestionList
()
this
.
getQuestionList
()
},
},
...
...
This diff is collapsed.
Click to expand it.
src/router/index.js
View file @
c53149d1
import
Vue
from
"
vue
"
;
import
Vue
from
"
vue
"
import
Router
from
"
vue-router
"
;
import
Router
from
"
vue-router
"
Vue
.
use
(
Router
)
;
Vue
.
use
(
Router
)
//登录 注册 激活
//登录 注册 激活
const
page
=
[
const
page
=
[
{
{
path
:
"
/
"
,
path
:
"
/
"
,
// redirect: "/feedback" //调试
redirect
:
"
/questionnaire
"
//调试
},
{
path
:
"
/login
"
,
meta
:
{
index
:
1
,
keepAlive
:
false
},
name
:
"
login
"
,
component
:
()
=>
import
(
"
@/pages/login
"
)
},
},
// {
// path: "/login",
// meta: { index: 1, keepAlive: false },
// name: "login",
// component: () => import("@/pages/login")
// },
{
{
path
:
`/feedback/:dataId`
,
path
:
`/feedback/:dataId`
,
meta
:
{
index
:
2
,
keepAlive
:
false
},
meta
:
{
index
:
2
,
keepAlive
:
false
},
...
@@ -20,44 +20,38 @@ const page = [
...
@@ -20,44 +20,38 @@ const page = [
component
:
()
=>
import
(
"
@/pages/feedback
"
)
component
:
()
=>
import
(
"
@/pages/feedback
"
)
},
},
{
{
path
:
`/questionnaire/:
dataI
d`
,
path
:
`/questionnaire/:
i
d`
,
meta
:
{
index
:
2
,
keepAlive
:
false
},
meta
:
{
index
:
2
,
keepAlive
:
false
},
name
:
"
questionnaire
"
,
name
:
"
questionnaire
"
,
component
:
()
=>
import
(
"
@/pages/questionnaire
"
)
component
:
()
=>
import
(
"
@/pages/questionnaire
"
)
}
}
]
;
]
const
router
=
new
Router
({
const
router
=
new
Router
({
// scrollBehavior: () => ({
// scrollBehavior: () => ({
// y: 0
// y: 0
// }),
// }),
routes
:
[...
page
]
routes
:
[...
page
]
})
;
})
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
if
(
from
.
meta
.
keepAlive
)
{
next
()
const
$wrapper
=
document
.
querySelector
(
"
.list_content
"
);
// 列表的外层容器 注意找到滚动的盒子
})
const
scrollTop
=
$wrapper
?
$wrapper
.
scrollTop
:
0
;
// console.log("scrollTop=", scrollTop);
from
.
meta
.
scrollTop
=
scrollTop
;
}
next
();
});
// 解决编程式路由往同一地址跳转时会报错的情况
// 解决编程式路由往同一地址跳转时会报错的情况
const
originalPush
=
Router
.
prototype
.
push
;
const
originalPush
=
Router
.
prototype
.
push
const
originalReplace
=
Router
.
prototype
.
replace
;
const
originalReplace
=
Router
.
prototype
.
replace
// push
// push
Router
.
prototype
.
push
=
function
push
(
location
,
onResolve
,
onReject
)
{
Router
.
prototype
.
push
=
function
push
(
location
,
onResolve
,
onReject
)
{
if
(
onResolve
||
onReject
)
if
(
onResolve
||
onReject
)
return
originalPush
.
call
(
this
,
location
,
onResolve
,
onReject
)
;
return
originalPush
.
call
(
this
,
location
,
onResolve
,
onReject
)
return
originalPush
.
call
(
this
,
location
).
catch
((
err
)
=>
err
)
;
return
originalPush
.
call
(
this
,
location
).
catch
((
err
)
=>
err
)
}
;
}
//replace
//replace
Router
.
prototype
.
replace
=
function
push
(
location
,
onResolve
,
onReject
)
{
Router
.
prototype
.
replace
=
function
push
(
location
,
onResolve
,
onReject
)
{
if
(
onResolve
||
onReject
)
if
(
onResolve
||
onReject
)
return
originalReplace
.
call
(
this
,
location
,
onResolve
,
onReject
)
;
return
originalReplace
.
call
(
this
,
location
,
onResolve
,
onReject
)
return
originalReplace
.
call
(
this
,
location
).
catch
((
err
)
=>
err
)
;
return
originalReplace
.
call
(
this
,
location
).
catch
((
err
)
=>
err
)
}
;
}
export
default
router
;
export
default
router
This diff is collapsed.
Click to expand it.
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