Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sedu-mobile-v2
Overview
Overview
Details
Activity
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
liuzhanxin
sedu-mobile-v2
Commits
759a18ec
Commit
759a18ec
authored
Feb 25, 2020
by
zhanxin liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
34593be7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
443 additions
and
109 deletions
+443
-109
util.js
cloudTrain/common/util.js
+5
-2
mescroll-body.css
cloudTrain/components/mescroll-uni/mescroll-body.css
+2
-1
index.vue
cloudTrain/pages/Security-Check/index.vue
+120
-35
security-checkitem.vue
cloudTrain/pages/Security-Check/security-checkitem.vue
+100
-24
security-task-list.vue
cloudTrain/pages/Security-Check/security-task-list.vue
+78
-12
select-checkobject.vue
cloudTrain/pages/Security-Check/select-checkobject.vue
+127
-28
index.vue
cloudTrain/pages/login/index.vue
+11
-7
No files found.
cloudTrain/common/util.js
View file @
759a18ec
var
url
=
""
;
var
url
=
"
http://47.94.204.226
"
;
var
addressSelectionTemp
=
[];
var
user
=
{};
var
sysInfo
=
{};
export
default
{
url
,
addressSelectionTemp
,
user
user
,
sysInfo
}
\ No newline at end of file
cloudTrain/components/mescroll-uni/mescroll-body.css
View file @
759a18ec
...
...
@@ -6,5 +6,5 @@ page {
position
:
relative
;
/* 下拉刷新区域相对自身定位 */
height
:
auto
;
/* 不可固定高度,否则overflow: hidden, 可通过设置最小高度使列表不满屏仍可下拉*/
overflow
:
hidden
;
/* 遮住顶部下拉刷新区域 */
box-sizing
:
border-box
;
/* 避免设置padding出现双滚动条的问题 */
box-sizing
:
border-box
;
/* 避免设置padding出现双滚动条的问题 */
}
\ No newline at end of file
cloudTrain/pages/Security-Check/index.vue
View file @
759a18ec
<
template
>
<view
class=
"content"
>
<text
class=
"title"
>
实验室名称:
{{
titl
e
}}
</text>
<text
class=
"title"
>
位置
</text>
<text
class=
"title"
>
实验室名称:
{{
objectData
.
nam
e
}}
</text>
<text
class=
"title"
style=
"margin-top: 30rpx;"
>
位置
</text>
<view
class=
"location-container"
>
<text
class=
"title"
>
{{
location
}}
</text>
<image
class=
"arrow-right"
src=
"../../static/common/arrow_right_gray.png"
>
<text
class=
"location"
>
{{
objectData
.
name
}}
</text>
</view>
<text
class=
"title"
style=
"margin-top: 30rpx;"
>
整改项详情
</text>
<view
style=
"width: 100%;"
>
<textarea
class=
"detail"
/>
</view>
<text
class=
"title"
style=
"margin-top: 30rpx;"
>
整改项照片
</text>
<view
style=
"width: 100%;display: flex;align-items: flex-start; justify-content: flex-start;margin-top: 30rpx;"
>
<view>
<button
@
click=
"onclick"
class=
"camera-button"
>
<image
class=
"camera"
src=
"../../static/common/camera.png"
>
</button>
</view>
</view>
<textarea
class=
"detail"
/>
<button
@
click=
"onclick"
class=
"camera-button"
>
<image
class=
"camera"
src=
"../../static/common/camera.png"
>
</button>
<button
hover-class=
"submithover"
@
click=
"onSubmitClick"
class=
"submit-button"
>
<text
class=
"submittext"
>
提交
</text>
</button>
...
...
@@ -26,46 +33,121 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
export
default
{
data
()
{
return
{
title
:
'虚拟仿真实验室'
,
location
:
"某个地址可能很长"
,
showActionSheet
:
false
,
maskClosable
:
true
,
tips
:
"确认清空搜索历史吗?"
,
itemList
:
[],
tips
:
"请选择"
,
color
:
"#9a9a9a"
,
size
:
26
,
isCancel
:
true
,
cityInfo
:[],
maxLevel
:
4
itemList
:
[{
text
:
"打开相机"
},{
text
:
"从相册中选择"
}],
objectData
:{},
checkitem
:{},
taskId
:
""
,
images
:[],
room
:{}
}
},
onLoad
()
{
onLoad
()
{
var
that
=
this
;
uni
.
$on
(
'addressSave'
,
function
(
data
){
console
.
log
(
this
.
GLOBALUTIL
.
addressSelectionTemp
);
})
uni
.
$on
(
'safeReportData'
,
function
(
data
){
that
.
objectData
=
data
[
0
]
that
.
checkitem
=
data
[
1
]
that
.
taskId
=
data
[
2
]
})
},
onUnload
(){
var
that
=
this
uni
.
$off
(
'addressSave'
,
function
(
data
){
this
.
GLOBALUTIL
.
addressSelectionTemp
=
[];
that
.
GLOBALUTIL
.
addressSelectionTemp
=
[];
})
uni
.
$on
(
'safeReportData'
,
function
(
data
){
})
},
methods
:
{
onclick
:
function
()
{
uni
.
chooseImage
({
sizeType
:
[
'original'
,
'compressed'
],
//可以指定是原图还是压缩图,默认二者都有
sourceType
:
[
'album'
],
//从相册选择
success
:
function
(
res
)
{
console
.
log
(
JSON
.
stringify
(
res
));
}
});
this
.
showActionSheet
=
true
;
},
onSubmitClick
:
function
()
{
uni
.
navigateTo
({
url
:
'../../components/address-select/index?maxLevel='
+
this
.
maxLevel
});
// uni.navigateTo({
// url:'../../components/address-select/index?maxLevel='+this.maxLevel
// });
var
body
=
{
"check_scope"
:
JSON
.
stringify
(
this
.
objectData
),
"check_item_id"
:
this
.
checkitem
.
id
,
"check_list_id"
:
this
.
checkitem
.
check_list_id
,
"check_task_id"
:
this
.
taskId
,
"images"
:
JSON
.
stringify
(
this
.
images
),
"place"
:
this
.
objectData
.
name
,
"description"
:
this
.
description
,
"room"
:
JSON
.
stringify
(
this
.
room
)
}
var
user
=
{};
user
.
id
=
this
.
GLOBALUTIL
.
user
.
userid
;
user
.
name
=
encodeURI
(
this
.
GLOBALUTIL
.
user
.
username
);
uni
.
request
({
url
:
this
.
GLOBALUTIL
.
url
+
'/safety/v1/danger'
,
method
:
'POST'
,
body
:
JSON
.
stringify
(
body
),
header
:
{
'Accept'
:
'application/json'
,
'Content-Type'
:
'application/x-www-form-urlencoded; charset=UTF-8'
,
'user'
:
JSON
.
stringify
(
user
)
},
success
:
(
res
)
=>
{
console
.
log
(
res
)
}
})
},
itemClick
:
function
(
item
)
{
var
that
=
this
if
(
item
.
index
==
0
){
uni
.
chooseImage
({
sizeType
:
[
'compressed'
],
//可以指定是原图还是压缩图,默认二者都有
sourceType
:
[
'camera'
],
//相机
success
:
function
(
res
)
{
var
imgPath
=
res
.
tempFilePaths
;
that
.
uploadPic
(
imgPath
);
}
});
}
else
{
uni
.
chooseImage
({
sizeType
:
[
'compressed'
],
//可以指定是原图还是压缩图,默认二者都有
sourceType
:
[
'album'
],
//从相册选择
success
:
function
(
res
)
{
var
imgPath
=
res
.
tempFilePaths
;
that
.
uploadPic
(
imgPath
);
}
});
}
this
.
closeActionSheet
();
},
itemClick
:
function
()
{
uploadPic
(
imgPath
){
var
currentTime
=
new
Date
().
getTime
();
var
formData
=
new
FormData
();
let
file
=
{
uri
:
imgPath
,
type
:
'application/octet-stream'
,
name
:
currentTime
+
'.jpg'
};
formData
.
append
(
"file"
,
file
);
var
user
=
{};
user
.
id
=
this
.
GLOBALUTIL
.
user
.
userid
;
user
.
name
=
encodeURI
(
this
.
GLOBALUTIL
.
user
.
username
);
console
.
log
(
formData
)
uni
.
request
({
url
:
this
.
GLOBALUTIL
.
url
+
'/safety/v1/file/image'
,
method
:
'POST'
,
body
:
formData
,
header
:
{
'Accept'
:
'application/json'
,
'Content-Type'
:
'multipart/form-data'
,
'user'
:
JSON
.
stringify
(
user
)
},
success
:
(
res
)
=>
{
console
.
log
(
res
)
}
})
},
closeActionSheet
:
function
()
{
this
.
showActionSheet
=
false
...
...
@@ -84,8 +166,6 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
.content
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
}
.logo
{
...
...
@@ -103,7 +183,7 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
}
.title
{
font-size
:
3
6
rpx
;
font-size
:
3
0
rpx
;
color
:
#8f8f94
;
}
.loginbtn
{
...
...
@@ -124,7 +204,7 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
center
;
width
:
100%
;
}
.arrow-right
{
width
:
40
rpx
;
...
...
@@ -150,6 +230,7 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
justify-content
:
center
;
background
:
linear-gradient
(
-45deg
,
rgba
(
87
,
225
,
181
,
1
)
0%
,
rgba
(
0
,
63
,
255
,
1
)
100%
);
border-radius
:
15
rpx
;
margin-top
:
80
rpx
;
}
.submittext
{
font-size
:
14px
;
...
...
@@ -160,12 +241,16 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
opacity
:
0.7
;
}
.detail
{
width
:
400
rpx
;
height
:
1
00
rpx
;
width
:
100%
;
height
:
3
00
rpx
;
border
:
1
rpx
solid
#000000
;
}
.status_bar
{
height
:
var
(
--status-bar-height
);
width
:
100%
;
}
.location
{
font-size
:
34
rpx
;
color
:
#000000
;
}
</
style
>
cloudTrain/pages/Security-Check/security-checkitem.vue
View file @
759a18ec
<
template
>
<mescroll-body
ref=
"mescrollRef"
@
init=
"mescrollInit"
:down=
"downOption"
:up=
"upOption"
@
down=
"downCallback"
@
up=
"upCallback"
>
<view
class=
"news-li"
v-for=
"(item,index) in dataList"
:key=
"index"
>
<mescroll-body
class=
"containter"
ref=
"mescrollRef"
@
init=
"mescrollInit"
:down=
"downOption"
:up=
"upOption"
@
down=
"downCallback"
@
up=
"upCallback"
>
<view
v-if=
"isShow"
class=
"news-li"
v-for=
"(item,index) in dataList"
:key=
"index"
>
<view>
<text>
{{
index
}}
.
{{
item
.
tex
t
}}
</text>
<text>
{{
index
}}
.
{{
item
.
conten
t
}}
</text>
</view>
<view
style=
"display: flex;flex-direction: row; width: 100%;justify-content: space-between;"
>
<view
style=
"display: flex;flex-direction: row;"
>
<view
class=
"item-container"
@
click=
"itemClick(index,1)"
>
<view
:class=
"item.status==1? 'selected' :'unselected' "
></view>
<text>
符合
</text>
</view>
<view
class=
"item-container"
@
click=
"itemClick(index,2)"
>
<view
:class=
"item.status==2? 'selected' :'unselected' "
></view>
<text>
不符合
</text>
</view>
<view
class=
"item-container"
@
click=
"itemClick(index,3)"
>
<view
:class=
"item.status==3? 'selected' :'unselected' "
></view>
<text>
不适用
</text>
<view
style=
"display: flex;flex-direction: row; width:690rpx;justify-content: space-between;margin-top:20rpx;"
>
<view
style=
"display: flex;flex-direction: row;justify-content: flex-start;"
>
<view
v-for=
"(obj,index1) in checkitems"
:key=
"index1"
>
<view
class=
"item-container"
@
click=
"itemClick(index,index1)"
>
<view
:class=
"item.status==index1? 'selected' :'unselected' "
></view>
<text>
{{
obj
.
name
}}
</text>
</view>
</view>
</view>
<view
><image
@
click=
"checkItem(item)"
class=
"icon"
src=
"../../static/security-check/safeEdit.png"
></view>
</view>
</view>
</view>
<button
hover-class=
"submithover"
@
click=
"onSubmitClick"
class=
"submit-button"
>
<text
class=
"submittext"
>
提交
</text>
</button>
</mescroll-body>
</
template
>
...
...
@@ -34,13 +31,36 @@
downOption
:
{
auto
:
false
//是否在初始化后,自动执行downCallback; 默认true
},
dataList
:
[
{
text
:
"问题"
,
status
:
1
},{
text
:
"问题"
,
status
:
1
},{
text
:
"问题"
,
status
:
1
},{
text
:
"问题"
,
status
:
1
}
],
dataList
:
[],
upOption
:
{
use
:
false
,
// 是否启用上拉加载; 默认true
},
},
isShow
:
false
,
checkitems
:[],
objectData
:{},
taskId
:
""
}
},
methods
:
{
methods
:
{
onLoad
()
{
var
that
=
this
;
uni
.
$on
(
'sendCheckItem'
,
function
(
data
){
that
.
objectData
=
data
[
0
]
that
.
taskId
=
data
[
2
];
var
content
=
data
[
1
].
children
content
.
map
((
opt
)
=>
{
opt
.
status
=
0
;
// opt.checkitems = [];
})
that
.
dataList
=
content
;
})
this
.
loadData
();
},
onUnload
(){
uni
.
$off
(
'sendCheckItem'
,
function
(
data
){
})
},
/*下拉刷新的回调 */
downCallback
()
{
this
.
mescroll
.
endSuccess
();
...
...
@@ -55,12 +75,40 @@
})
},
itemClick
(
index
,
status
){
this
.
dataList
[
index
].
status
=
status
this
.
dataList
[
index
].
status
=
status
;
this
.
$forceUpdate
();
},
checkItem
(){
checkItem
(
item
){
uni
.
navigateTo
({
url
:
"./index"
})
uni
.
$emit
(
"safeReportData"
,[
this
.
objectData
,
item
,
this
.
taskId
]);
},
loadData
(){
var
user
=
{};
user
.
id
=
this
.
GLOBALUTIL
.
user
.
userid
;
user
.
name
=
encodeURI
(
this
.
GLOBALUTIL
.
user
.
username
);
uni
.
request
({
url
:
this
.
GLOBALUTIL
.
url
+
'/base-data/v1/dict-items?sort_property=ID&sort_direction=ASC&dict_code=JCJG&page_number=1&page_size=10'
,
method
:
'GET'
,
header
:
{
'Accept'
:
'application/json'
,
'Content-Type'
:
'application/x-www-form-urlencoded; charset=UTF-8'
,
'user'
:
JSON
.
stringify
(
user
)
},
body
:
null
,
success
:
(
res
)
=>
{
this
.
dataList
.
map
((
opt
)
=>
{
opt
.
checkitems
=
res
.
data
.
data
;
})
this
.
checkitems
=
res
.
data
.
data
;
this
.
isShow
=
true
;
}
})
},
onSubmitClick
(){
}
}
}
...
...
@@ -75,10 +123,13 @@
text-align
:
center
;
}
/*展示上拉加载的数据列表*/
.news-li
{
.news-li
{
display
:
flex
;
flex-direction
:
column
;
font-size
:
32
upx
;
padding
:
32
upx
;
border-bottom
:
1
upx
solid
#eee
;
border-bottom
:
1
upx
solid
#eee
;
width
:
100%
;
}
.news-li
.new-content
{
font-size
:
28
upx
;
...
...
@@ -113,5 +164,30 @@
height
:
40
rpx
;
background-color
:
#FFFFFF
;
border
:
1
rpx
solid
#00CE47
;
}
.containter
{
display
:
flex
;
width
:
100%
;
}
.submit-button
{
display
:
flex
;
width
:
600
rpx
;
height
:
60
rpx
;
align-items
:
center
;
justify-content
:
center
;
background
:
linear-gradient
(
-45deg
,
rgba
(
87
,
225
,
181
,
1
)
0%
,
rgba
(
0
,
63
,
255
,
1
)
100%
);
border-radius
:
15
rpx
;
position
:
absolute
;
left
:
50%
;
bottom
:
60
rpx
;
margin-left
:
-300
rpx
;
}
.submittext
{
font-size
:
14px
;
color
:
#FFFFFF
;
font-family
:
-apple-system
,
BlinkMacSystemFont
,
'Segoe UI'
,
Roboto
,
Oxygen
,
Ubuntu
,
Cantarell
,
'Open Sans'
,
'Helvetica Neue'
,
sans-serif
;
}
.submithover
{
opacity
:
0.7
;
}
</
style
>
cloudTrain/pages/Security-Check/security-task-list.vue
View file @
759a18ec
<
template
>
<mescroll-body
ref=
"mescrollRef"
@
init=
"mescrollInit"
:down=
"downOption"
:up=
"upOption"
@
down=
"downCallback"
@
up=
"upCallback"
>
<view
class=
"news-li"
v-for=
"news in dataList"
:key=
"news.id"
hover-class=
"hover"
@
click=
"goDetail"
>
<view
class=
"news-li"
v-for=
"news in dataList"
:key=
"news.id"
hover-class=
"hover"
@
click=
"goDetail
(news)
"
>
<view
class=
"top-container"
>
<text
class=
"title"
>
安全检查任务
</text>
<text
class=
"title"
>
{{
news
.
name
}}
</text>
<view
class=
"status"
>
<text
class=
"status-text"
>
未完成 0/1
</text>
<text
class=
"status-text"
>
{{
news
.
taskstatus
}}
</text>
</view>
</view>
<view><text
class=
"des"
>
打我撒
</text></view>
<view><image
class=
"icon"
src=
"../../static/security-check/safeTime.png"
><text
class=
""
>
2020-20123
</text></view>
<view><image
class=
"icon"
src=
"../../static/security-check/safeSys.png"
><text>
城建楼宿舍
</text></view>
<view><image
class=
"icon"
src=
"../../static/security-check/safePerson.png"
><text>
陆冬梅
</text></view>
<view><text>
自建任务
</text></view>
<view><text
class=
"des"
>
{{
news
.
check_point
}}
</text></view>
<view><image
class=
"icon"
src=
"../../static/security-check/safeTime.png"
><text
class=
"detail"
>
{{
JSON
.
parse
(
news
.
schedule
).
startdate
}}
~
{{
JSON
.
parse
(
news
.
schedule
).
enddate
}}
</text></view>
<view
style=
"display: flex;flex-direction: row;align-items: center;"
>
<image
class=
"icon"
src=
"../../static/security-check/safeSys.png"
>
<view
style=
"display: flex;flex-direction: column;"
v-for=
"(data,index) in JSON.parse(news.check_scope)"
:key=
"index"
>
<text
class=
"detail"
>
{{
data
.
name
}}
</text>
</view>
</view>
<view><image
class=
"icon"
src=
"../../static/security-check/safePerson.png"
><text
class=
"detail"
>
陆冬梅
</text></view>
<view><text
class=
"type"
>
自建任务
</text></view>
</view>
</mescroll-body>
</
template
>
...
...
@@ -25,13 +30,16 @@
downOption
:
{
auto
:
false
//是否在初始化后,自动执行downCallback; 默认true
},
dataList
:
[
1
,
2
,
3
,
4
,
5
,
6
,
6
,
7
,
8
,
8
],
dataList
:
[],
upOption
:
{
use
:
false
,
// 是否启用上拉加载; 默认true
},
}
},
methods
:
{
methods
:
{
onLoad
()
{
this
.
loadData
();
},
/*下拉刷新的回调 */
downCallback
()
{
this
.
mescroll
.
endSuccess
();
...
...
@@ -40,9 +48,60 @@
upCallback
(
page
)
{
},
goDetail
(){
/*获取列表*/
loadData
(){
var
body
=
{};
var
user
=
{};
user
.
id
=
this
.
GLOBALUTIL
.
user
.
userid
;
user
.
name
=
encodeURI
(
this
.
GLOBALUTIL
.
user
.
username
);
uni
.
request
({
url
:
this
.
GLOBALUTIL
.
url
+
'/safety/v1/check-tasks?page_size=200&page_number=1'
,
method
:
'GET'
,
header
:
{
'Accept'
:
'application/json'
,
'Content-Type'
:
'application/x-www-form-urlencoded; charset=UTF-8'
,
'user'
:
JSON
.
stringify
(
user
)
},
body
:
null
,
success
:
(
res
)
=>
{
var
data
=
res
.
data
.
data
;
data
.
map
((
opt
)
=>
{
opt
.
taskstatus
=
this
.
handleStatus
(
opt
);
var
taskexecutor
=
JSON
.
parse
(
opt
.
excutor
);
var
taskexecutortext
=
""
;
taskexecutor
.
map
((
opt
)
=>
{
taskexecutortext
=
opt
.
name
+
" "
;
})
opt
.
taskexecutor
=
taskexecutortext
;
})
this
.
dataList
=
data
;
}
})
},
handleStatus
(
data
){
var
text
=
""
;
if
(
data
.
execute_state
){
var
check_scope
=
JSON
.
parse
(
data
.
check_scope
);
text
=
"已完成"
+
check_scope
.
length
+
"/"
+
check_scope
.
length
;
}
else
{
var
check_scope
=
JSON
.
parse
(
data
.
check_scope
);
var
checked
=
0
;
check_scope
.
map
((
opt
)
=>
{
if
(
opt
.
execute_state
){
checked
++
}
})
if
(
checked
==
check_scope
.
length
){
text
=
"已完成 "
+
check_scope
.
length
+
"/"
+
check_scope
.
length
;
}
else
{
text
=
'未完成 '
+
checked
+
'/'
+
check_scope
.
length
;
}
}
return
text
},
goDetail
(
data
){
uni
.
navigateTo
({
url
:
"./select-checkobject
"
url
:
"./select-checkobject
?taskId="
+
data
.
id
})
}
}
...
...
@@ -72,6 +131,7 @@
.icon
{
width
:
20
rpx
;
height
:
20
rpx
;
margin-right
:
20
rpx
;
}
.top-container
{
display
:
flex
;
...
...
@@ -103,5 +163,11 @@
font-weight
:
200
;
font-size
:
14px
;
color
:
#676767
}
.detail
{
font-size
:
14px
;
}
.type
{
font-size
:
14px
;
}
</
style
>
cloudTrain/pages/Security-Check/select-checkobject.vue
View file @
759a18ec
<
template
>
<view
class=
"content"
>
<
text
class=
"title"
>
检查对象
</text
>
<view
class=
"location-container"
@
click=
"show
Picker"
>
<text
class=
"
title"
>
{{
location
}}
</text>
<
view
style=
"width: 100%;margin-top: 20rpx;"
><text
class=
"title"
>
检查对象
</text></view
>
<view
class=
"location-container"
@
click=
"showObject
Picker"
>
<text
class=
"
value"
>
{{
selObjectText
}}
</text>
<image
class=
"arrow-right"
src=
"../../static/common/arrow_right_gray.png"
>
</view>
<
text
class=
"title"
>
检查项类型
</text
>
<view
class=
"location-container"
@
click=
"showPicker"
>
<text
class=
"
title"
>
{{
location
}}
</text>
<
view
style=
"width: 100%;margin-top: 20rpx;"
><text
class=
"title"
>
检查项类型
</text></view
>
<view
class=
"location-container"
@
click=
"show
Type
Picker"
>
<text
class=
"
value"
>
{{
selectItemText
}}
</text>
<image
class=
"arrow-right"
src=
"../../static/common/arrow_right_gray.png"
>
</view>
<button
hover-class=
"submithover"
@
click=
"onSubmitClick"
class=
"submit-button"
>
...
...
@@ -29,23 +29,24 @@ import Picker from "@/components/w-picker/w-picker.vue";
export
default
{
data
()
{
return
{
title
:
'虚拟仿真实验室'
,
location
:
""
,
showActionSheet
:
false
,
maskClosable
:
true
,
tips
:
"确认清空搜索历史吗?"
,
itemList
:
[{
label
:
"aaa"
,
value
:
"10"
}],
color
:
"#9a9a9a"
,
size
:
26
,
isCancel
:
true
,
cityInfo
:[],
maxLevel
:
4
itemList
:
[],
taskId
:
""
,
selObject
:
""
,
selObjectText
:
""
,
selectItem
:
""
,
selectItemText
:
""
,
objectarr
:[],
itemarr
:[],
curType
:
"object"
,
objectData
:[],
itemData
:[]
}
},
onLoad
(
)
{
},
onLoad
(
option
)
{
this
.
taskId
=
option
.
taskId
this
.
loadTaskObject
();
},
methods
:
{
itemClick
:
function
()
{
...
...
@@ -54,15 +55,103 @@ import Picker from "@/components/w-picker/w-picker.vue";
this
.
showActionSheet
=
false
},
onConfirm
(
data
){
console
.
log
(
data
)
if
(
this
.
curType
==
"object"
){
this
.
selObject
=
data
.
checkValue
[
0
];
this
.
selObjectText
=
data
.
checkArr
[
0
];
this
.
itemarr
=
[];
this
.
selectItem
=
""
;
this
.
selectItemText
=
""
;
this
.
loadItemData
();
}
else
{
this
.
selectItem
=
data
.
checkValue
[
0
];
this
.
selectItemText
=
data
.
checkArr
[
0
];
}
},
onSubmitClick
(){
var
objectData
=
this
.
findObjectData
();
var
itemData
=
this
.
findItemData
();
uni
.
navigateTo
({
url
:
"security-checkitem"
})
uni
.
$emit
(
"sendCheckItem"
,[
objectData
,
itemData
,
this
.
taskId
]);
},
showObjectPicker
(){
this
.
itemList
=
this
.
objectarr
;
this
.
curType
=
"object"
this
.
$refs
.
picker
.
show
()
},
showTypePicker
(){
if
(
this
.
selObject
==
""
){
return
}
this
.
itemList
=
this
.
itemarr
;
this
.
curType
=
"item"
;
this
.
$refs
.
picker
.
show
()
},
loadTaskObject
(){
var
user
=
{};
user
.
id
=
this
.
GLOBALUTIL
.
user
.
userid
;
user
.
name
=
encodeURI
(
this
.
GLOBALUTIL
.
user
.
username
);
uni
.
request
({
url
:
this
.
GLOBALUTIL
.
url
+
'/safety/v1/check-task-scope/'
+
this
.
taskId
,
method
:
'GET'
,
header
:
{
'Accept'
:
'application/json'
,
'Content-Type'
:
'application/x-www-form-urlencoded; charset=UTF-8'
,
'user'
:
JSON
.
stringify
(
user
)
},
body
:
null
,
success
:
(
res
)
=>
{
var
data
=
res
.
data
;
this
.
objectData
=
data
;
var
itemList
=
data
.
map
((
opt
)
=>
{
return
{
label
:
opt
.
name
,
value
:
opt
.
id
};
})
this
.
objectarr
=
itemList
;
this
.
itemList
=
itemList
;
}
})
},
showPicker
(){
this
.
$refs
.
picker
.
show
()
loadItemData
(){
var
user
=
{};
user
.
id
=
this
.
GLOBALUTIL
.
user
.
userid
;
user
.
name
=
encodeURI
(
this
.
GLOBALUTIL
.
user
.
username
);
uni
.
request
({
url
:
this
.
GLOBALUTIL
.
url
+
'/safety/v1/check-task-lists/'
+
this
.
taskId
+
"?check_site_id="
+
this
.
selObject
,
method
:
'GET'
,
header
:
{
'Accept'
:
'application/json'
,
'Content-Type'
:
'application/x-www-form-urlencoded; charset=UTF-8'
,
'user'
:
JSON
.
stringify
(
user
)
},
body
:
null
,
success
:
(
res
)
=>
{
var
data
=
res
.
data
;
this
.
itemData
=
data
;
var
itemList
=
data
.
map
((
opt
)
=>
{
return
{
label
:
opt
.
content
,
value
:
opt
.
id
};
})
this
.
itemarr
=
itemList
;
}
})
},
findObjectData
(){
var
obj
=
{};
this
.
objectData
.
map
((
opt
)
=>
{
if
(
opt
.
id
==
this
.
selObject
){
obj
=
opt
;
}
})
return
obj
;
},
findItemData
(){
var
obj
=
{};
this
.
itemData
.
map
((
opt
)
=>
{
if
(
opt
.
id
==
this
.
selectItem
){
obj
=
opt
;
}
})
return
obj
;
}
},
...
...
@@ -77,7 +166,6 @@ import Picker from "@/components/w-picker/w-picker.vue";
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
}
.logo
{
...
...
@@ -95,8 +183,9 @@ import Picker from "@/components/w-picker/w-picker.vue";
}
.title
{
font-size
:
36
rpx
;
color
:
#8f8f94
;
font-size
:
30
rpx
;
color
:
#8f8f94
;
width
:
100%
;
}
.loginbtn
{
width
:
180
rpx
;
...
...
@@ -116,7 +205,11 @@ import Picker from "@/components/w-picker/w-picker.vue";
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
flex-end
;
width
:
100%
;
height
:
60
rpx
;
border-bottom
:
1
rpx
solid
#898989
;
}
.arrow-right
{
width
:
40
rpx
;
...
...
@@ -142,6 +235,7 @@ import Picker from "@/components/w-picker/w-picker.vue";
justify-content
:
center
;
background
:
linear-gradient
(
-45deg
,
rgba
(
87
,
225
,
181
,
1
)
0%
,
rgba
(
0
,
63
,
255
,
1
)
100%
);
border-radius
:
15
rpx
;
margin-top
:
80
rpx
;
}
.submittext
{
font-size
:
14px
;
...
...
@@ -159,5 +253,10 @@ import Picker from "@/components/w-picker/w-picker.vue";
.status_bar
{
height
:
var
(
--status-bar-height
);
width
:
100%
;
}
}
.value
{
font-size
:
30
rpx
;
color
:
#000000
;
width
:
100%
;
}
</
style
>
cloudTrain/pages/login/index.vue
View file @
759a18ec
...
...
@@ -46,15 +46,19 @@
return
{
providerList
:
[],
hasProvider
:
false
,
account
:
''
,
password
:
''
,
account
:
'
20040998
'
,
password
:
'
password
'
,
positionTop
:
0
,
isDevtools
:
false
,
}
},
// computed: mapState(['forcedLogin']),
methods
:
{
onLoad
()
{
const
sysInfo
=
uni
.
getSystemInfoSync
();
console
.
log
(
sysInfo
.
windowWidth
)
this
.
GLOBALUTIL
.
sysInfo
=
sysInfo
},
initPosition
()
{
/**
* 使用 absolute 定位,并且设置 bottom 值进行定位。软键盘弹出时,底部会因为窗口变化而被顶上来。
...
...
@@ -73,7 +77,7 @@
}
var
bodyStr
=
form
.
join
(
"&"
);
uni
.
request
({
url
:
'http://47.94.204.226
/client/api'
,
//仅为示例,并非真实接口地址。
url
:
this
.
GLOBALUTIL
.
url
+
'
/client/api'
,
//仅为示例,并非真实接口地址。
method
:
'POST'
,
data
:
body
,
header
:
{
...
...
@@ -84,8 +88,8 @@
this
.
GLOBALUTIL
.
user
=
res
.
data
.
loginresponse
console
.
log
(
res
.
data
);
this
.
text
=
'request success'
;
uni
.
reLaunch
({
url
:
'../Security-Check/
index
'
,
uni
.
navigateTo
({
url
:
'../Security-Check/
security-task-list
'
,
});
}
})
...
...
@@ -162,7 +166,7 @@
*/
if
(
this
.
forcedLogin
)
{
uni
.
reLaunch
({
url
:
'../Security-Check/
index
'
,
url
:
'../Security-Check/
security-task-list
'
,
});
}
else
{
uni
.
navigateBack
();
...
...
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