Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
study
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Damon
study
Commits
bc7f6b93
Commit
bc7f6b93
authored
Jul 22, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 获取科目接口
parent
4b21073b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
85 deletions
+35
-85
learn.js
src/api/learn.js
+10
-4
addExam.vue
src/pages/learn/addExam.vue
+1
-1
selectCategory.vue
src/pages/learn/selectCategory.vue
+24
-80
No files found.
src/api/learn.js
View file @
bc7f6b93
...
@@ -2,14 +2,20 @@ let learnApiFun = function(vm) {
...
@@ -2,14 +2,20 @@ let learnApiFun = function(vm) {
const
globalUrl
=
process
.
uniEnv
||
{}
const
globalUrl
=
process
.
uniEnv
||
{}
let
ucenterApiUrl
=
globalUrl
.
uUrl
let
ucenterApiUrl
=
globalUrl
.
uUrl
let
getQuestion
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'/rest/question/query/getQuestion'
,
params
)
let
getQuestion
=
async
(
params
=
{})
=>
let
getQuestionTotal
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'/rest/question/query/getQuestionTotal'
,
params
)
await
vm
.
$u
.
post
(
'/rest/question/query/getQuestion'
,
params
)
let
answer
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'/rest/question/save/answer'
,
params
)
let
getQuestionTotal
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'/rest/question/query/getQuestionTotal'
,
params
)
let
answer
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'/rest/question/save/answer'
,
params
)
let
subjectList
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/rest/question/query/subjectList'
,
params
)
const
learnApi
=
{
const
learnApi
=
{
getQuestion
,
getQuestion
,
getQuestionTotal
,
getQuestionTotal
,
answer
answer
,
subjectList
,
}
}
return
learnApi
return
learnApi
}
}
...
...
src/pages/learn/addExam.vue
View file @
bc7f6b93
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<view>
<view>
<view
class=
"category-view"
>
<view
class=
"category-view"
>
<image
class=
"image-view"
:src=
"shangyijiImage"
></image>
<image
class=
"image-view"
:src=
"shangyijiImage"
></image>
<text
class=
"category-text"
>
{{
category
.
name
}}
</text>
<text
class=
"category-text"
>
{{
category
.
label
}}
</text>
</view>
</view>
</view>
</view>
<view
class=
"label-title"
>
<view
class=
"label-title"
>
...
...
src/pages/learn/selectCategory.vue
View file @
bc7f6b93
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
<view
class=
"label-title"
:id=
"key + index"
>
<view
class=
"label-title"
:id=
"key + index"
>
<!-- 品类title -->
<!-- 品类title -->
<view>
{{
<view>
{{
key
==
secondKey
?
labels
[
firstKey
][
0
][
index
].
name
:
'非煤矿类'
key
==
secondKey
?
labels
[
firstKey
][
0
][
index
].
label
:
'非煤矿类'
}}
</view>
}}
</view>
</view>
</view>
<view
class=
"label-content"
>
<view
class=
"label-content"
>
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
]"
]"
@click="handleClick(key, index, ind, label)"
@click="handleClick(key, index, ind, label)"
>
>
<text
class=
"label-text"
>
{{
label
.
name
}}
</text>
<text
class=
"label-text"
>
{{
label
.
label
}}
</text>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -121,86 +121,30 @@ export default {
...
@@ -121,86 +121,30 @@ export default {
},
},
// 获取品类
// 获取品类
loadLabel
()
{
async
loadLabel
()
{
// async loadLabel(key, selectedId) {
this
.
tapLoading
=
true
// this.tapLoading = true;
let
param
=
{}
// let param = {};
let
res
=
await
this
.
$u
.
api
.
subjectList
(
param
)
// if (key == key2) {
// // 获取二级品类列表
// param.selectedId = selectedId; // 选中的一级品类
// }
// let res = await this.$u.api.fileLabel(param);
// this.tapLoading = false
// if (res && res.code == 200) {
// this.labels[key] = res.data || [];
this
.
tapLoading
=
false
this
.
tapLoading
=
false
this
.
labels
=
{
var
filterItems
=
res
.
filter
((
item
)
=>
{
[
key1
]:
[
return
item
.
parentId
==
0
[
})
{
var
mItem
=
filterItems
[
0
]
name
:
'特种作业人员'
,
this
.
labels
[
key1
][
0
]
=
[]
id
:
'c-0'
,
for
(
var
item
of
res
)
{
},
if
(
item
.
parentId
==
mItem
.
id
)
{
{
this
.
labels
[
key1
][
0
].
push
(
item
)
name
:
'特种作业人员1'
,
}
id
:
'c-1'
,
}
},
for
(
var
i
=
0
;
i
<
this
.
labels
[
key1
].
length
;
i
++
)
{
{
var
data
=
this
.
labels
[
key1
][
0
][
i
]
name
:
'特种作业人员2'
,
this
.
labels
[
key2
][
i
]
=
[]
id
:
'c-2'
,
for
(
var
item
of
res
)
{
},
if
(
item
.
parentId
==
data
.
id
)
{
],
this
.
labels
[
key2
][
i
].
push
(
item
)
],
}
[
key2
]:
[
}
[
{
name
:
'0-登高架设作业-0'
,
id
:
'c-00'
,
},
{
name
:
'0-登高架设作业-1'
,
id
:
'c-01'
,
},
{
name
:
'0-登高架设作业-2'
,
id
:
'c-02'
,
},
],
[
{
name
:
'1-登高架设作业-0'
,
id
:
'c-10'
,
},
{
name
:
'1-登高架设作业-1'
,
id
:
'c-11'
,
},
{
name
:
'1-登高架设作业-2'
,
id
:
'c-12'
,
},
],
[
{
name
:
'2-登高架设作业-0'
,
id
:
'c-20'
,
},
{
name
:
'2-登高架设作业-1'
,
id
:
'c-21'
,
},
{
name
:
'2-登高架设作业-3'
,
id
:
'c-22'
,
},
],
],
}
}
// 初次进入页面,需要获取二级品类列表
this
.
selected
[
key1
]
=
this
.
labels
[
key1
][
0
][
0
]
// }
},
},
// 本页数据设置,用于其他页面访问本页数据
// 本页数据设置,用于其他页面访问本页数据
setPageInfo
(
info
)
{
setPageInfo
(
info
)
{
...
...
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