Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-web-h5app-taihe
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
zhuxiaomei
patzn-cloud-web-h5app-taihe
Commits
c680e4f8
Commit
c680e4f8
authored
Jan 06, 2021
by
zhuxiaomei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分类查询 抽样条码前端 温湿度位置
parent
17564213
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
245 additions
and
12 deletions
+245
-12
.env.development
.env.development
+1
-1
app-version.js
src/api/base/app-version.js
+1
-2
index.js
src/api/index.js
+5
-1
env-monitor.js
src/api/res/env-monitor.js
+1
-1
sample.js
src/api/taihe/sample.js
+9
-0
Class.vue
src/page/Class.vue
+27
-2
Index.vue
src/page/Index.vue
+85
-0
ScanBar.vue
src/page/ScanBar.vue
+11
-3
RegisterAdd.vue
src/page/register/RegisterAdd.vue
+13
-0
SelectLoc.vue
src/page/register/components/SelectLoc.vue
+64
-0
SamplingCodeAdd.vue
src/page/sampling-code/SamplingCodeAdd.vue
+28
-2
No files found.
.env.development
View file @
c680e4f8
NODE_ENV=development
VUE_APP_BASE_URL=http://192.168.0.
39
:7000
VUE_APP_BASE_URL=http://192.168.0.
13
:7000
src/api/base/app-version.js
View file @
c680e4f8
...
...
@@ -2,10 +2,9 @@
* 系统相关
*/
import
http
from
'../http'
import
Global
from
'../config'
export
default
{
//检测版本,自动更新
version
:
data
=>
http
.
post
(
'/base/v1/app_version/'
+
data
.
name
+
'_'
+
data
.
device
+
'?version='
+
G
lobal
.
version
()).
then
(
res
=>
res
),
version
:
data
=>
http
.
post
(
'/base/v1/app_version/'
+
data
.
name
+
'_'
+
data
.
device
+
'?version='
+
this
.
$g
lobal
.
version
()).
then
(
res
=>
res
),
}
src/api/index.js
View file @
c680e4f8
...
...
@@ -5,7 +5,7 @@ export {default as sso} from './base/sso'
// export {default as resource} from './base/resource'
// export {default as userRelResource} from './base/user-rel-resource'
export
{
default
as
sysUser
}
from
'./base/user'
//
export {default as appVersion} from './base/app-version'
export
{
default
as
appVersion
}
from
'./base/app-version'
// export {default as flowProcess} from './base/flow-process'
// export {default as email} from './base/email'
export
{
default
as
sms
}
from
'./base/sms'
...
...
@@ -25,4 +25,8 @@ export {default as envMonitorRecord} from './res/env-monitor-record'
*/
export
{
default
as
message
}
from
'./message/message'
/**
* taihe
*/
export
{
default
as
sample
}
from
'./taihe/sample'
src/api/res/env-monitor.js
View file @
c680e4f8
...
...
@@ -9,5 +9,5 @@ export default {
edit
:
data
=>
http
.
put
(
'/res/v1/env_monitor/'
+
data
.
id
,
data
.
obj
).
then
(
res
=>
res
),
deleteByIds
:
ids
=>
http
.
delete
(
'/res/v1/env_monitor/?ids='
+
ids
).
then
(
res
=>
res
),
getById
:
id
=>
http
.
get
(
'/res/v1/env_monitor/'
+
id
).
then
(
res
=>
res
),
locList
:
data
=>
http
.
post
(
'/res/v1/env_monitor/list_location'
,
data
).
then
(
res
=>
res
),
}
src/api/taihe/sample.js
0 → 100644
View file @
c680e4f8
/**
*
*/
import
http
from
'../http'
export
default
{
sampleByQrcode
:
data
=>
http
.
post
(
'/taihe/v1/sample/sample_by_qrcode'
,
data
).
then
(
res
=>
res
),
}
src/page/Class.vue
View file @
c680e4f8
...
...
@@ -6,29 +6,54 @@
right-icon=
"scan"
placeholder=
"请输入或扫码条码"
@
click-right-icon=
"_scan"
@
input=
"_getInfo"
></van-field>
<div
class=
"layout-cont-btn"
>
<div
class=
"result-item"
v-if=
"noData===false&&Object.keys(sampleInfo).length"
>
<div
style=
"width: 100%"
>
大类:
{{
sampleInfo
.
firstClass
}}
</div>
<div
style=
"width: 100%"
>
亚类:
{{
sampleInfo
.
secondClass
}}
</div>
<div
style=
"width: 100%"
>
次亚类:
{{
sampleInfo
.
thirdClass
}}
</div>
<div
style=
"width: 100%"
>
细类:
{{
sampleInfo
.
detectType
}}
</div>
</div>
<div
style=
"color: #969799;text-align: center;margin: 10px 0"
v-else-if=
"noData===true"
>
未找到相关数据
</div>
</div>
</div>
</
template
>
<
script
>
import
{
mapMutations
}
from
"vuex"
;
import
{
sample
}
from
'../api'
export
default
{
name
:
"class"
,
data
()
{
return
{
code
:
''
code
:
''
,
sampleInfo
:
{},
noData
:
false
}
},
mounted
()
{
this
.
code
=
this
.
$store
.
state
.
barcode
this
.
setBarcode
()
if
(
this
.
code
)
{
this
.
_getInfo
()
}
},
methods
:
{
...
mapMutations
([
"setBarcode"
]),
_scan
()
{
this
.
$router
.
push
(
'/scan_bar'
)
},
_getInfo
:
async
function
()
{
let
result
=
await
sample
.
sampleByQrcode
({
qrcode
:
this
.
code
})
if
(
result
)
{
this
.
sampleInfo
=
result
this
.
noData
=
false
}
else
{
this
.
noData
=
true
}
}
}
}
...
...
src/page/Index.vue
View file @
c680e4f8
...
...
@@ -13,6 +13,8 @@
<
script
>
import
{
appVersion
}
from
'../api'
export
default
{
name
:
"Index"
,
computed
:
{
...
...
@@ -28,8 +30,26 @@
}
}
},
data
()
{
return
{
newVersion
:
''
,
versionLog
:
''
,
//更新日志内容
newVersionUri
:
''
,
//更新地址
}
},
mounted
()
{
this
.
_login
()
try
{
if
(
plus
.
os
.
name
===
'Android'
)
{
//每次进来都给予提示(android)
this
.
_testVersion
(
0
);
}
else
if
(
plus
.
os
.
name
!==
'Android'
)
{
//每次进来都给予提示(ios)
this
.
_testVersion
(
1
);
}
}
catch
(
e
)
{
//
}
},
methods
:
{
_login
()
{
...
...
@@ -44,7 +64,72 @@
if
(
this
.
$route
.
meta
.
leftArrow
!==
false
)
{
this
.
$router
.
go
(
-
1
)
}
},
//检测新版本
_testVersion
:
async
function
(
device
)
{
//device-----0:安卓,1:ios
//name ----- 应用程序名称 随便起,跟梦琪对接好
let
result
=
await
appVersion
.
version
({
name
:
'taihe'
,
device
:
device
})
if
(
result
)
{
this
.
newVersion
=
result
.
version
;
this
.
newVersionUri
=
result
.
uri
;
this
.
versionLog
=
result
.
log
;
this
.
_tip
(
result
.
required
);
}
},
//更新提示
_tip
(
required
)
{
let
that
=
this
;
this
.
$dialog
.
confirm
({
title
:
'检测到新版本'
,
message
:
'v'
+
that
.
newVersion
+
' 新版本上线!'
+
this
.
versionLog
,
confirmButtonText
:
'马上升级'
,
cancelButtonText
:
'知道了'
,
confirmButtonColor
:
'#1989fa'
,
showCancelButton
:
required
===
1
?
false
:
true
,
//true(required=1) 表示非强制更新,false(required=0) 表示强制更新
}).
then
(()
=>
{
that
.
_ok
();
//升级
}).
catch
(()
=>
{
// on cancel
});
},
//升级
_ok
()
{
if
(
plus
.
os
.
name
)
{
if
(
plus
.
os
.
name
===
'Android'
)
{
this
.
_androidOk
();
}
else
{
this
.
_iosOk
();
}
}
},
_androidOk
()
{
this
.
$toast
.
loading
({
message
:
'下载中...'
,
forbidClick
:
true
,
});
let
url
=
this
.
newVersionUri
;
// 下载文件地址
let
dtask
=
plus
.
downloader
.
createDownload
(
url
,
{},
(
d
,
status
)
=>
{
if
(
status
==
200
)
{
// 下载成功
this
.
_downApk
(
d
.
filename
);
}
else
{
//下载失败
this
.
$toast
(
'下载失败'
)
}
});
dtask
.
start
();
},
//跳转到appStore商店
_iosOk
()
{
plus
.
runtime
.
openURL
(
this
.
newVersionUri
);
},
//下载apk(安卓)
_downApk
(
filename
)
{
// 安装下载的apk文件
plus
.
runtime
.
install
(
filename
,
{},
()
=>
{
});
},
}
}
</
script
>
...
...
src/page/ScanBar.vue
View file @
c680e4f8
...
...
@@ -35,7 +35,11 @@
}
},
mounted
()
{
try
{
this
.
_open
()
}
catch
(
e
)
{
//
}
//返回键操作
mui
.
init
({
beforeback
:
function
()
{
...
...
@@ -50,13 +54,13 @@
barcode
=
null
;
let
that
=
this
;
if
(
!
barcode
)
{
barcode
=
new
plus
.
barcode
.
Barcode
(
'bcid'
,
[
plus
.
barcode
.
CODE128
],
{
barcode
=
new
plus
.
barcode
.
Barcode
(
'bcid'
,
[
plus
.
barcode
.
CODE128
,
plus
.
barcode
.
EAN13
,
plus
.
barcode
.
EAN8
],
{
frameColor
:
'#00FF00'
,
scanbarColor
:
'#00FF00'
});
barcode
.
onmarked
=
function
(
type
,
result
)
{
if
(
type
===
plus
.
barcode
.
CODE128
)
{
console
.
log
(
result
,
'result'
)
if
(
type
===
plus
.
barcode
.
CODE128
||
type
===
plus
.
barcode
.
EAN13
||
type
===
plus
.
barcode
.
EAN8
)
{
console
.
log
(
result
,
'result'
)
that
.
setBarcode
(
result
)
barcode
.
close
();
that
.
$router
.
go
(
-
1
);
...
...
@@ -71,7 +75,11 @@
barcode
.
start
();
},
_cancelScan
()
{
try
{
barcode
.
close
();
}
catch
(
e
)
{
//
}
this
.
$router
.
go
(
-
1
)
},
// _scanPicture() {
...
...
src/page/register/RegisterAdd.vue
View file @
c680e4f8
...
...
@@ -7,6 +7,8 @@
label=
"位置"
placeholder=
"位置"
:rules=
"[
{ required: true, message: '请填写位置'}]"
right-icon="add-o"
@click-right-icon="_locSelect"
>
</van-field>
<van-field
v-model=
"formObj.humidity"
...
...
@@ -51,13 +53,18 @@
@
cancel=
"showDatePicker = false"
></van-datetime-picker>
</van-popup>
<SelectLoc
ref=
"loc"
@
on-result-change=
"_locResult"
></SelectLoc>
</div>
</
template
>
<
script
>
import
{
envMonitor
}
from
'../../api'
import
SelectLoc
from
'./components/SelectLoc'
export
default
{
components
:
{
SelectLoc
},
data
()
{
return
{
showDatePicker
:
false
,
...
...
@@ -135,6 +142,12 @@
}
this
.
showDatePicker
=
false
},
_locSelect
()
{
this
.
$refs
.
loc
.
_open
()
},
_locResult
(
data
)
{
this
.
$set
(
this
.
formObj
,
'location'
,
data
)
}
}
}
</
script
>
...
...
src/page/register/components/SelectLoc.vue
0 → 100644
View file @
c680e4f8
<
template
>
<van-popup
v-model=
"showPicker"
position=
"bottom"
:safe-area-inset-bottom=
"true"
:close-on-popstate=
"true"
>
<div
style=
"height: 70vh;overflow: hidden;background: #f7f8fa"
>
<search-bar
ref=
"searchBar"
label=
"位置"
:fixed=
"false"
@
search=
"_search"
></search-bar>
<div
style=
"height:calc(100% - 55px);overflow:auto"
>
<div
class=
"result-item"
v-for=
"item in resultList"
:key=
"item.id"
@
click=
"_tapResult(item)"
>
<div>
{{
item
}}
</div>
</div>
</div>
</div>
</van-popup>
</
template
>
<
script
>
import
{
envMonitor
}
from
'../../../api'
export
default
{
data
()
{
return
{
key
:
''
,
resultList
:
[],
showPicker
:
false
}
},
methods
:
{
_open
()
{
this
.
showPicker
=
true
this
.
key
=
''
this
.
$nextTick
(
function
()
{
this
.
$refs
.
searchBar
.
searchValue
=
''
})
this
.
_getData
()
},
//简单查询 清空高级查询条件 赋值简单查询数据
_search
(
value
)
{
this
.
key
=
value
this
.
_getData
()
},
_searchParams
()
{
let
obj
=
{}
if
(
this
.
key
)
{
obj
.
location
=
this
.
key
}
return
obj
},
_getData
:
async
function
()
{
let
result
=
await
envMonitor
.
locList
(
this
.
_searchParams
())
this
.
resultList
=
result
},
_tapResult
(
item
)
{
this
.
$emit
(
'on-result-change'
,
item
)
this
.
showPicker
=
false
},
}
}
</
script
>
<
style
scoped
>
</
style
>
src/page/sampling-code/SamplingCodeAdd.vue
View file @
c680e4f8
...
...
@@ -16,27 +16,53 @@
</div>
<div
class=
"bottom-btn"
>
<van-button
square
block
type=
"default"
@
click=
"_back"
>
取消
</van-button>
<van-button
square
block
type=
"info"
@
click=
"_saveNext"
>
保存并下一个
</van-button>
<van-button
square
block
type=
"info"
@
click=
"_save"
v-if=
"id"
>
保存
</van-button>
<van-button
square
block
type=
"info"
@
click=
"_saveNext"
v-else
>
保存并下一个
</van-button>
</div>
</div>
</
template
>
<
script
>
import
{
mapMutations
}
from
"vuex"
;
// import {envMonitor} from '../../api'
export
default
{
name
:
"SamplingCodeAdd"
,
data
()
{
return
{
code
:
''
code
:
''
,
id
:
''
}
},
mounted
()
{
this
.
code
=
this
.
$store
.
state
.
barcode
this
.
setBarcode
()
this
.
_open
()
},
methods
:
{
...
mapMutations
([
"setBarcode"
]),
_open
()
{
if
(
this
.
$route
.
query
.
id
)
{
//编辑
this
.
id
=
this
.
$route
.
query
.
id
this
.
_getData
()
}
else
{
this
.
id
=
''
}
},
_getData
:
async
function
()
{
// let result = await envMonitor.getById(this.id)
// if (result) {
// for (let key in this.formObj) {
// if (result[key]) {
// if (key === 'monitorDate') {
// this.formObj[key] = this.$dateformat(result[key], 'yyyy-mm-dd')
// } else {
// this.formObj[key] = result[key]
// }
// }
// }
// }
},
_scan
()
{
this
.
$router
.
push
(
'/scan_bar'
)
},
...
...
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