Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
董杰
/
induction_shelf
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9aae8f83
由
韩晓涛
编写于
2025-01-10 15:02:44 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
树莓派页面调整
1 个父辈
54085d57
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
194 行增加
和
149 行删除
smartshelf/app/templates/head.html
smartshelf/app/templates/induction_admin.html
smartshelf/app/templates/induction_test.html
smartshelf/app/templates/head.html
查看文件 @
9aae8f8
...
@@ -31,12 +31,10 @@
...
@@ -31,12 +31,10 @@
<div
id=
"navbar"
class=
"navbar-collapse collapse"
>
<div
id=
"navbar"
class=
"navbar-collapse collapse"
>
<ul
class=
"nav navbar-nav"
>
<ul
class=
"nav navbar-nav"
>
<li
<li
{{
"
class=
active"
if
index=
=1
}}
><a
href=
"{{ url_for('induction_control') }}"
>
{{ _('通用') }}
</a></li>
{{
"
class=
active"
if
index=
=1
}}
><a
href=
"{{ url_for('induction_control') }}"
>
{{ _('通用') }}
</a></li>
<li
{{
"
class=
active"
if
index=
=2
}}
><a
href=
"{{ url_for('induction_test') }}"
>
{{ _('测试') }}
</a>
</li>
<li
<li
{{
"
class=
active"
if
index=
=3
}}
><a
href=
"{{ url_for('induction_config') }}"
>
{{ _('配置') }}
</a>
</li>
{{
"
class=
active"
if
index=
=2
}}
><a
href=
"{{ url_for('induction_test') }}"
>
{{ _('测试') }}
</a>
</li>
<!-- <li {{ " class=active" if index==3 }}><a href="{{ url_for('induction_admin') }}">{{ _('admin') }}</a> </li>-->
<li
{{
"
class=
active"
if
index=
=3
}}
><a
href=
"{{ url_for('induction_config') }}"
>
{{ _('配置') }}
</a>
</li>
</ul>
</ul>
<ul
class=
"nav navbar-nav navbar-right"
style=
"font-size: 14px;"
<ul
class=
"nav navbar-nav navbar-right"
style=
"font-size: 14px;"
"
>
"
>
...
...
smartshelf/app/templates/induction_admin.html
查看文件 @
9aae8f8
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
onclick=
"hancalibrate()"
/>
onclick=
"hancalibrate()"
/>
<input
type=
"button"
value=
"{{ _('获取阈值') }}"
class=
"btn btn-warning"
<input
type=
"button"
value=
"{{ _('获取阈值') }}"
class=
"btn btn-warning"
onclick=
"getcalibrate()"
/>
onclick=
"getcalibrate()"
/>
</div>
<!-- /.col-sm-4 -->
</div>
</div>
</div>
</div>
</div>
...
...
smartshelf/app/templates/induction_test.html
查看文件 @
9aae8f8
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<title>
{{ _('感应式料架系统') }}
</title>
<link
rel=
"icon"
href=
"/static/favicon.ico"
>
<link
href=
"/static/css/bootstrap.min.css"
rel=
"stylesheet"
>
<script
src=
"/static/js/jquery.min.js"
></script>
<script
src=
"/static/js/bootstrap.min.js"
></script>
<title>
{{ _('感应式料架系统') }}
</title>
<link
rel=
"icon"
href=
"/static/favicon.ico"
>
<link
href=
"/static/css/bootstrap.min.css"
rel=
"stylesheet"
>
<script
src=
"/static/js/jquery.min.js"
></script>
<script
src=
"/static/js/bootstrap.min.js"
></script>
<style>
.row
{
margin-bottom
:
10px
;
}
</style>
</head>
</head>
<body
style=
"font-size:18px;"
>
<body
style=
"font-size:18px;"
>
{% set index=2 %}
{% set index=2 %}
{% import 'head.html' as head with context%}
{% import 'head.html' as head with context%}
{{ head }}
{{ head }}
<div
class=
"container-fluid"
>
<div
class=
"container-fluid"
>
<div
class=
"row"
>
<div
class=
"row"
>
<hr
class=
"divider"
/><hr
class=
"divider"
/><hr
class=
"divider"
/>
<hr
class=
"divider"
/>
<hr
class=
"divider"
/>
<hr
class=
"divider"
/>
<div
class=
"col-md-6"
>
<div
class=
"col-md-6"
>
<!--div class="panel panel-info">
<!--div class="panel panel-info">
<div class="panel-heading">
<div class="panel-heading">
...
@@ -47,8 +53,10 @@
...
@@ -47,8 +53,10 @@
<h3
class=
"panel-title"
>
{{ _('灯条测试') }}
</h3>
<h3
class=
"panel-title"
>
{{ _('灯条测试') }}
</h3>
</div>
</div>
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
<div
class=
"row align-items-start"
>
<div
class=
"col"
>
<label
for=
"cha"
class=
"col-sm-2"
>
{{ _('地址') }}
</label>
<label
for=
"cha"
class=
"col-sm-2"
>
{{ _('地址') }}
</label>
<div
class=
"col-sm-3
"
>
<div
class=
"col-sm-4
"
>
<select
id=
'addrs'
class=
"form-control"
>
<select
id=
'addrs'
class=
"form-control"
>
<option>
A1
</option>
<option>
A1
</option>
<option>
A2
</option>
<option>
A2
</option>
...
@@ -70,21 +78,23 @@
...
@@ -70,21 +78,23 @@
<option>
B9
</option>
<option>
B9
</option>
<option>
all
</option>
<option>
all
</option>
</select>
</select>
</div>
<!-- /.col-sm-4 -->
</div>
</div>
<div
class=
"col"
>
<label
for=
"cha1"
class=
"col-sm-2"
>
{{ _('颜色') }}
</label>
<label
for=
"cha1"
class=
"col-sm-2"
>
{{ _('颜色') }}
</label>
<div
class=
"col-sm-3
"
>
<div
class=
"col-sm-4
"
>
<select
id=
'linecolor'
class=
"form-control"
>
<select
id=
'linecolor'
class=
"form-control"
>
{% for color in colors %}
{% for color in colors %}
<option>
{{ color }}
</option>
<option>
{{ color }}
</option>
{% endfor %}
{% endfor %}
</select>
</select>
</div>
</div>
<div
class=
"col-sm-12"
style=
"padding: 3px;"
>
</div>
</div>
</div>
<div
class=
"col-sm-6"
"
>
<div
class=
"col-sm-6"
>
<input
type=
"button"
value=
{{
_
('开启')
}}
class=
"btn btn-warning"
onclick=
"indlineledon()"
/>
<input
type=
"button"
value=
{{
_
('开启')
}}
class=
"btn btn-warning"
onclick=
"indlineledon()"
/>
<input
type=
"button"
value=
{{
_
('关闭')
}}
class=
"btn btn-info"
onclick=
"indlineledoff()"
/>
<input
type=
"button"
value=
{{
_
('关闭')
}}
class=
"btn btn-info"
onclick=
"indlineledoff()"
/>
</div>
<!-- /.col-sm-4 -->
</div>
</div>
</div>
</div>
</div>
<div
class=
"panel panel-success"
>
<div
class=
"panel panel-success"
>
...
@@ -92,29 +102,34 @@
...
@@ -92,29 +102,34 @@
<h3
class=
"panel-title"
>
{{ _('库位操作测试') }}
</h3>
<h3
class=
"panel-title"
>
{{ _('库位操作测试') }}
</h3>
</div>
</div>
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
<div
class=
"row align-items-start"
>
<div
class=
"col"
>
<label
for=
"stock_cha1"
class=
"col-sm-2"
>
{{ _('库位') }}
</label>
<label
for=
"stock_cha1"
class=
"col-sm-2"
>
{{ _('库位') }}
</label>
<div
class=
"col-sm-5
"
>
<div
class=
"col-sm-4
"
>
<select
id=
"led_address"
class=
"form-control"
>
<select
id=
"led_address"
class=
"form-control"
>
{% for optionv in option_list %}
{% for optionv in option_list %}
<option>
{{ optionv }}
</option>
<option>
{{ optionv }}
</option>
{% endfor %}
{% endfor %}
</select>
</select>
</div>
</div>
</div>
<div
class=
"col"
>
<label
for=
"cha2"
class=
"col-sm-2"
>
{{ _('颜色') }}
</label>
<label
for=
"cha2"
class=
"col-sm-2"
>
{{ _('颜色') }}
</label>
<div
class=
"col-sm-3
"
>
<div
class=
"col-sm-4
"
>
<select
id=
'indexcolor'
class=
"form-control"
>
<select
id=
'indexcolor'
class=
"form-control"
>
{% for color in colors %}
{% for color in colors %}
<option>
{{ color }}
</option>
<option>
{{ color }}
</option>
{% endfor %}
{% endfor %}
</select>
</select>
</div>
</div>
<div
class=
"col-sm-12"
style=
"padding: 3px;"
></div>
</div>
</div>
<div
class=
"col-sm-12"
>
<div
class=
"col-sm-12"
>
<input
type=
"button"
value=
{{
_
('亮灯')
}}
class=
"btn btn-warning"
onclick=
"indledopen()"
/>
<input
type=
"button"
value=
{{
_
('亮灯')
}}
class=
"btn btn-warning"
onclick=
"indledopen()"
/>
<input
type=
"button"
value=
{{
_
('灭灯')
}}
class=
"btn btn-info"
onclick=
"indledoff()"
/>
<input
type=
"button"
value=
{{
_
('灭灯')
}}
class=
"btn btn-info"
onclick=
"indledoff()"
/>
<input
type=
"button"
value=
{{
_
('重置')
}}
class=
"btn btn-info"
onclick=
"indresetled()"
/>
<input
type=
"button"
value=
{{
_
('重置')
}}
class=
"btn btn-info"
onclick=
"indresetled()"
/>
<input
type=
"button"
value=
{{
_
('标定')
}}
class=
"btn btn-info"
onclick=
"single_calibrate()"
/>
<input
type=
"button"
value=
{{
_
('标定')
}}
class=
"btn btn-info"
onclick=
"single_calibrate()"
/>
</div>
<!-- /.col-sm-4 -->
</div>
</div>
</div>
</div>
</div>
<div
class=
"panel panel-success"
>
<div
class=
"panel panel-success"
>
...
@@ -209,103 +224,118 @@
...
@@ -209,103 +224,118 @@
getstate
();
getstate
();
console
.
log
(
'success'
);
console
.
log
(
'success'
);
});
});
// 获取开机关机状态
// 获取开机关机状态
function
getstate
()
{
function
getstate
()
{
// var form= new FormData(document.getElementById("test_form"));
// var form= new FormData(document.getElementById("test_form"));
$
.
ajax
({
$
.
ajax
({
url
:
"/getstate"
,
url
:
"/getstate"
,
type
:
"post"
,
type
:
"post"
,
// data:form,
// data:form,
dataType
:
'json'
,
dataType
:
'json'
,
processData
:
false
,
processData
:
false
,
contentType
:
false
,
contentType
:
false
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
console
.
log
(
data
)
console
.
log
(
data
)
if
(
data
[
0
].
state
==
'on'
)
{
$
(
"#shelfstate"
).
html
(
"{{_('运行中')}}"
);}
if
(
data
[
0
].
state
==
'on'
)
{
else
if
(
data
[
0
].
state
==
'off'
)
{
$
(
"#shelfstate"
).
html
(
"{{_('已关闭')}}"
);}
$
(
"#shelfstate"
).
html
(
"{{_('运行中')}}"
);
else
{
$
(
"#shelfstate"
).
html
(
"{{_('未初始化')}}"
);}
}
else
if
(
data
[
0
].
state
==
'off'
)
{
$
(
"#shelfstate"
).
html
(
"{{_('已关闭')}}"
);
}
else
{
$
(
"#shelfstate"
).
html
(
"{{_('未初始化')}}"
);
}
// $("#shelfstate").html("<b>已关闭</b>")
// $("#shelfstate").html("<b>已关闭</b>")
// $("#testinfo").html(data[0].msg)
// $("#testinfo").html(data[0].msg)
$
(
"#serialstate"
).
html
(
data
[
0
].
serial_state
)
$
(
"#serialstate"
).
html
(
data
[
0
].
serial_state
)
},
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
alert
(
"未获取到状态信息"
);
alert
(
"未获取到状态信息"
);
}
}
})
})
}
}
// 灯条测试
// 灯条测试
function
indlineledon
()
{
function
indlineledon
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
}
else
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
var
addrs
=
document
.
getElementById
(
"addrs"
).
value
;
}
else
{
addrs
=
addrs
.
replace
(
'B'
,
'A1'
);
var
addrs
=
document
.
getElementById
(
"addrs"
).
value
;
addrs
=
addrs
.
replace
(
'A'
,
''
);
addrs
=
addrs
.
replace
(
'B'
,
'A1'
);
var
data
=
{
"channel_num"
:
addrs
,
addrs
=
addrs
.
replace
(
'A'
,
''
);
"channel_color"
:
document
.
getElementById
(
"linecolor"
).
value
}
var
data
=
{
"channel_num"
:
addrs
,
"channel_color"
:
document
.
getElementById
(
"linecolor"
).
value
}
console
.
log
(
data
)
console
.
log
(
data
)
$
.
ajax
({
$
.
ajax
({
url
:
"/indlineledon"
,
url
:
"/indlineledon"
,
type
:
"post"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
contentType
:
"application/json"
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
$
(
"#testinfo"
).
html
(
data
.
msg
)
// alert (data.msg)
// alert (data.msg)
},
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
alert
(
"error"
);
alert
(
"error"
);
}
}
})
})
}
}
}
}
function
indlineledoff
()
{
function
indlineledoff
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
}
else
{
var
addrs
=
document
.
getElementById
(
"addrs"
).
value
;
var
addrs
=
document
.
getElementById
(
"addrs"
).
value
;
addrs
=
addrs
.
replace
(
'B'
,
'A1'
);
addrs
=
addrs
.
replace
(
'B'
,
'A1'
);
addrs
=
addrs
.
replace
(
'A'
,
''
);
addrs
=
addrs
.
replace
(
'A'
,
''
);
var
data
=
{
"channel_num"
:
addrs
,
var
data
=
{
"channel_color"
:
'off'
}
"channel_num"
:
addrs
,
"channel_color"
:
'off'
}
// var form= new FormData(document.getElementById("test_form"));
// var form= new FormData(document.getElementById("test_form"));
// var data = {"word":"hello"}
// var data = {"word":"hello"}
console
.
log
(
data
)
console
.
log
(
data
)
$
.
ajax
({
$
.
ajax
({
url
:
"/indlineledoff"
,
url
:
"/indlineledoff"
,
type
:
"post"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
data
:
JSON
.
stringify
(
data
),
dataType
:
'json'
,
dataType
:
'json'
,
contentType
:
"application/json"
,
contentType
:
"application/json"
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
alert
(
"error"
);
alert
(
"error"
);
}
}
})
})
}
}
}
}
// 库位灯测试
// 库位灯测试
function
indledopen
()
{
function
indledopen
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
}
else
{
var
data
=
{
"light_led_color"
:
document
.
getElementById
(
"indexcolor"
).
value
,
var
data
=
{
"light_led"
:
document
.
getElementById
(
"led_address"
).
value
}
"light_led_color"
:
document
.
getElementById
(
"indexcolor"
).
value
,
"light_led"
:
document
.
getElementById
(
"led_address"
).
value
}
$
.
ajax
({
$
.
ajax
({
url
:
"/indledopen"
,
url
:
"/indledopen"
,
type
:
"post"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
contentType
:
"application/json"
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
alert
(
"error"
);
alert
(
"error"
);
}
}
})
})
...
@@ -313,23 +343,26 @@
...
@@ -313,23 +343,26 @@
}
}
// 库位灯测试
// 库位灯测试
function
indledoff
()
{
function
indledoff
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
}
else
{
var
data
=
{
"light_led_color"
:
"off"
,
var
data
=
{
"light_led"
:
document
.
getElementById
(
"led_address"
).
value
}
"light_led_color"
:
"off"
,
"light_led"
:
document
.
getElementById
(
"led_address"
).
value
}
// console.log(data)
// console.log(data)
$
.
ajax
({
$
.
ajax
({
url
:
"/indledoff"
,
url
:
"/indledoff"
,
type
:
"post"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
contentType
:
"application/json"
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
alert
(
"error"
);
alert
(
"error"
);
}
}
})
})
...
@@ -337,42 +370,46 @@
...
@@ -337,42 +370,46 @@
}
}
// 状态灯测试
// 状态灯测试
function
indworkinglight
()
{
function
indworkinglight
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
}
else
{
var
data
=
{
var
data
=
{
"workchannel"
:
document
.
getElementById
(
"workchannel"
).
value
,
"workchannel"
:
document
.
getElementById
(
"workchannel"
).
value
,
"command"
:
'worklight'
}
"command"
:
'worklight'
}
$
.
ajax
({
$
.
ajax
({
url
:
"/indworkinglight"
,
url
:
"/indworkinglight"
,
type
:
"post"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
contentType
:
"application/json"
,
dataType
:
'json'
,
dataType
:
'json'
,
// processData: false,//用于对data参数进行序列化处理 这里必须false
// processData: false,//用于对data参数进行序列化处理 这里必须false
// contentType: false, //必须
// contentType: false, //必须
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
alert
(
"error"
);
alert
(
"error"
);
}
}
})
})
}
}
}
}
// auto_calibrate
// auto_calibrate
function
single_calibrate
()
{
function
single_calibrate
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
);
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
);
return
;
return
;
}
}
if
(
confirm
(
"{{ _('操作前请确保该库位中没有物料') }}"
))
{
if
(
confirm
(
"{{ _('操作前请确保该库位中没有物料') }}"
))
{
var
data
=
{
"light_led_color"
:
document
.
getElementById
(
"indexcolor"
).
value
,
var
data
=
{
"light_led"
:
document
.
getElementById
(
"led_address"
).
value
}
"light_led_color"
:
document
.
getElementById
(
"indexcolor"
).
value
,
"light_led"
:
document
.
getElementById
(
"led_address"
).
value
}
$
.
ajax
({
$
.
ajax
({
url
:
"/single_calibrate"
,
url
:
"/single_calibrate"
,
type
:
"post"
,
type
:
"post"
,
...
@@ -391,25 +428,27 @@
...
@@ -391,25 +428,27 @@
}
}
function
indworkingoff
()
{
function
indworkingoff
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
}
else
{
var
data
=
{
var
data
=
{
"workchannel"
:
document
.
getElementById
(
"workchannel"
).
value
,
"workchannel"
:
document
.
getElementById
(
"workchannel"
).
value
,
"command"
:
'workoff'
}
"command"
:
'workoff'
}
$
.
ajax
({
$
.
ajax
({
url
:
"/indworkingoff"
,
url
:
"/indworkingoff"
,
type
:
"post"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
contentType
:
"application/json"
,
dataType
:
'json'
,
dataType
:
'json'
,
// processData: false,//用于对data参数进行序列化处理 这里必须false
// processData: false,//用于对data参数进行序列化处理 这里必须false
// contentType: false, //必须
// contentType: false, //必须
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
alert
(
"error"
);
alert
(
"error"
);
}
}
})
})
...
@@ -417,20 +456,21 @@
...
@@ -417,20 +456,21 @@
}
}
// 库位灯重置
// 库位灯重置
function
indresetled
()
{
function
indresetled
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
}
else
{
$
.
ajax
({
$
.
ajax
({
url
:
"/indresetled"
,
url
:
"/indresetled"
,
type
:
"post"
,
type
:
"post"
,
// data:JSON.stringify(data),
// data:JSON.stringify(data),
contentType
:
"application/json"
,
contentType
:
"application/json"
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
alert
(
"error"
);
alert
(
"error"
);
}
}
})
})
...
@@ -438,21 +478,22 @@
...
@@ -438,21 +478,22 @@
}
}
// 检查串口连接状态
// 检查串口连接状态
function
checkcom
()
{
function
checkcom
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
}
else
{
$
.
ajax
({
$
.
ajax
({
url
:
"/checkcom"
,
url
:
"/checkcom"
,
type
:
"post"
,
type
:
"post"
,
// data:JSON.stringify(data),
// data:JSON.stringify(data),
contentType
:
"application/json"
,
contentType
:
"application/json"
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
$
(
"#testinfo"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
alert
(
data
.
msg
)
},
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
alert
(
"error"
);
alert
(
"error"
);
}
}
})
})
...
@@ -460,22 +501,23 @@
...
@@ -460,22 +501,23 @@
}
}
// 扫描所有串口
// 扫描所有串口
function
scancom
()
{
function
scancom
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
}
else
{
$
.
ajax
({
$
.
ajax
({
url
:
"/scancom"
,
url
:
"/scancom"
,
type
:
"post"
,
type
:
"post"
,
// data:JSON.stringify(data),
// data:JSON.stringify(data),
contentType
:
"application/json"
,
contentType
:
"application/json"
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
$
(
"#testinfo"
).
html
(
data
.
msg
)
$
(
"#serialstate"
).
html
(
data
.
msg
)
$
(
"#serialstate"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
alert
(
data
.
msg
)
},
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
alert
(
"error"
);
alert
(
"error"
);
}
}
})
})
...
@@ -483,23 +525,25 @@
...
@@ -483,23 +525,25 @@
}
}
// 重置主板
// 重置主板
function
resetmain
()
{
function
resetmain
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
}
else
{
var
data
=
{
var
data
=
{
"command"
:
"reset"
}
"command"
:
"reset"
}
$
.
ajax
({
$
.
ajax
({
url
:
"/resetmain"
,
url
:
"/resetmain"
,
type
:
"post"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
contentType
:
"application/json"
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
$
(
"#testinfo"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
alert
(
data
.
msg
)
},
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
alert
(
"重置失败"
);
alert
(
"重置失败"
);
}
}
})
})
...
@@ -507,23 +551,25 @@
...
@@ -507,23 +551,25 @@
}
}
// 重置power
// 重置power
function
powermain
()
{
function
powermain
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
}
else
{
var
data
=
{
var
data
=
{
"command"
:
"power"
}
"command"
:
"power"
}
$
.
ajax
({
$
.
ajax
({
url
:
"/powermain"
,
url
:
"/powermain"
,
type
:
"post"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
contentType
:
"application/json"
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
$
(
"#testinfo"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
alert
(
data
.
msg
)
},
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
alert
(
"power重置失败"
);
alert
(
"power重置失败"
);
}
}
})
})
...
@@ -531,21 +577,22 @@
...
@@ -531,21 +577,22 @@
}
}
// 开启扫描自动测试
// 开启扫描自动测试
function
scantest
()
{
function
scantest
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
}
else
{
$
.
ajax
({
$
.
ajax
({
url
:
"/scantest"
,
url
:
"/scantest"
,
type
:
"post"
,
type
:
"post"
,
// data:JSON.stringify(data),
// data:JSON.stringify(data),
contentType
:
"application/json"
,
contentType
:
"application/json"
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
$
(
"#testinfo"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
alert
(
data
.
msg
)
},
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
alert
(
"启动扫描库位失败"
);
alert
(
"启动扫描库位失败"
);
}
}
})
})
...
@@ -553,18 +600,18 @@
...
@@ -553,18 +600,18 @@
}
}
// 关闭扫描自动测试
// 关闭扫描自动测试
function
stopscantest
()
{
function
stopscantest
()
{
$
.
ajax
({
$
.
ajax
({
url
:
"/stopscantest"
,
url
:
"/stopscantest"
,
type
:
"post"
,
type
:
"post"
,
// data:JSON.stringify(data),
// data:JSON.stringify(data),
contentType
:
"application/json"
,
contentType
:
"application/json"
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
$
(
"#testinfo"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
alert
(
data
.
msg
)
},
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
alert
(
"停止失败"
);
alert
(
"停止失败"
);
}
}
})
})
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论